Skip to content

Fix the Notes API compatibility gaps that break Iotas #28

Closed

Description

@gnacho

Reviewing the Iotas source (the GNOME client this backend targets) against the live deployment found four protocol mismatches, all verified with curl against production.

1. Capabilities are XML-only. Iotas requests /ocs/v2.php/cloud/capabilities with Accept: application/json and parses the body as JSON (response["ocs"]["data"]["capabilities"]["notes"]). We answer application/xml, so the parse fails and it reports "Notes app not installed". Fix: honour the requested format and return JSON (with api_version as a JSON array), keeping XML as the default.

2. favorite is only accepted as a boolean. Iotas always sends favorite: 1|0 in PUT /notes/{id}; our input struct uses *bool, so the request fails. Verified: favorite: 1 -> 400 invalid json, favorite: true -> 200. Fix: accept both a boolean and 0/1.

3. readonly is never returned. Iotas reads note_dict["readonly"] directly, so a missing key raises KeyError. The list handler builds the JSON by hand without it, and the single-note responses marshal a struct tagged json:"readonly,omitempty". Fix: always include readonly in list and single-note responses.

4. pruneBefore returns the wrong set and can delete notes. Per the spec, notes unchanged before the timestamp must be returned as {"id": N} stubs, not omitted. Our store filters them out (modified < pruneBefore), so the response contains only stubs for the OLD notes and omits the recently modified ones. Iotas computes remote deletions as local ids - response ids, marks those as locally deleted and then deletes them on the server, so the notes edited since the last sync would be deleted. Because Last-Modified is already sent (set to the current time), this triggers on the second sync. Fix: return all notes and let the handler emit stubs for modified < pruneBefore, and set Last-Modified to the newest note modified time instead of the current time.

Activity

  1. added a commit that references this issue on Sep 13, 2026
    e7704cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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