Skip to content

Not that atomic, unfortunately #4

Open
@staltz

Description

@staltz

I've been receiving bug reports for Manyverse (hence we can assume Android is the OS), consistently about the same bug (and crash) related to atomic-file used in ssb-conn (specifically, in ssb-conn-db) which look like:

SyntaxError: Unexpected token , in JSON at position 132
    at JSON.parse (<anonymous>)
    at Object.decode (node_modules/atomic-file/codec/json.js:6:17)
    at /atomic-file/index.js:43:25

I myself have also experienced this on my Android device. I have opened conn.json on my Android device to see how it looks like at those declared positions, and it's usually some extraneous }\n,}}, (or something like that) added to the end of the file.

I don't know how those extra characters get added to the file, but I know that they are getting added, and this happens in a variety of devices. My suspicion is that the fs.rename hack isn't quite working, perhaps because Android is not POSIX compatible or because rename isn't always atomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions