Meteor-Community-Packages / Meteor-Community-Packages/ground-db

Offline method calls when reconnect doesn't authenticate

Open
#26 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Make QA test
Dominant language
JavaScript
Stars
569
Forks
77
PR merge metrics
No merged PRs in 30d

Description

When a client connects and the GroundDB is populated, it allows offline work, which is pretty spectacular.

My concern is let's say the auth tokens are expired on the server while the client is offline, after reconnecting the method calls are run, but without a Meteor.userId, the server doesn't accept the changes. So all the offline work is lost.

You can test this by visiting http://grounddb.meteor.com/, logging in, disconnecting, queuing up some methods, manually modifying the auth-token (to simulate a server-side expiration), then reloading the page. All the offline changes are lost.

Is there a pattern for preventing the queued method calls from running until a Meteor.userId exists? If this were resolved, GroundDB would exactly fit a project I am about to start working on.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GroundDB's reconnect handling and queued method execution, then reproduce the issue using the described offline login, token-expiration, reload, and queued-method steps. Done means queued calls wait until a Meteor.userId exists after reconnect and offline changes are not lost when authentication has expired.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.