Skip to content

Data loss when using PUT on slow, unreliable internet connections #2080

@angelo-v

Description

@angelo-v

Environment

  • Server version: 7.1.7
  • Node.js version: v24.2.0
  • npm version: 11.3.0

Description

A PUT request completely deletes file contents on server side before all data has been successfully processed. This can lead to a complete data loss of the respective file on slow / unreliable internet connections.

To reproduce:

  1. setup a local CSS server and setup a pod with a markdown document, e.g. /alice/markdown.md
  2. write some content to this document
  3. use browser dev tools to throttle internet. I tested with these settings in chrome:
  • Download 5 kbit/s
  • Upload 3 kbit/s
  • Latency 300ms
  • Packet loss 5%
  • Packet length queue 3
  1. make a PUT request to write new content to the file, e.g.
fetch("http://localhost:3000/alice/markdown.md", {
  "headers": {
    "content-type": "text/markdown",
  },
  "body": "some markdown content, propably not too short to have some data to process",
  "method": "PUT"
});

Actual behaviour:

  • As soon as the PUT request reaches the server the markdown file is completely cleared from existing content
  • The fetch is still pending due to the bad connection
  • server responds with status 500
  • new file content is not saved, the old content is lost

Logs from CSS:

2025-10-22T15:29:33.396Z [HandlerServerConfigurator] {Primary} info: Received PUT request for /alice/markdown.md
2025-10-22T15:29:33.399Z [DPoPWebIdExtractor] {Primary} info: Verified WebID via DPoP-bound access token. [...]
2025-10-22T15:29:33.402Z [WebAclReader] {Primary} info: Found applicable ACL document [...]
2025-10-22T15:29:39.407Z [WrappedExpiringReadWriteLocker] {Primary} error: Lock expired after 6000ms on http://localhost:3000/alice/markdown.md

Expected behaviour

Either the new content should be saved successfully or the old content should still be present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions