Skip to content

An edit made just before a page reload never syncs to the server #6485

Backlog

Description

@rtibblesbot

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable

Observed behavior

An edit made less than ~2 seconds before reloading the channel editor stays in the browser's IndexedDB changesForSyncing table with no synced flag. After the reload the editor shows the edit, read from IndexedDB, but POST /api/sync/ never sends it.

syncChanges in serverSync.js sends only the revs in the in-memory changeRevs array, and nothing repopulates it on page load. Only forceServerSync, which publishing calls, sends every unsynced change.

Expected behavior

A change left unsynced by a reload reaches the server on the next sync after the page loads.

User-facing consequences

  • Collaborators, other tabs and other devices never see the edit.
  • The server copy stays stale until the author publishes.

Steps to reproduce

  1. Open a channel with an exercise and open the exercise's Questions tab in the edit modal.
  2. Click Edit on a question, type a word into the prompt and click Close.
  3. Within 2 seconds, reload the page.
  4. Wait 20 seconds, then open /api/assessmentitem?contentnode=<exercise node id>: raw_data lacks the typed word.
  5. In DevTools > Application > IndexedDB > KolibriStudio > changesForSyncing, the change is still there, unsynced.

Context

Acceptance Criteria

  • After the steps above, the server's raw_data contains the typed word within one sync interval of the reload, without publishing.
  • A Jest test covers a change present in changesForSyncing but not in changeRevs being sent by the next sync.

AI usage

Claude Code found this during automated browser QA of #6484, traced it to serverSync.js and drafted this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions