You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix the Notes API compatibility gaps that break Iotas #28
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
fix(api): close the Notes API gaps that break Iotas (#29)