Meteor-Community-Packages / Meteor-Community-Packages/ground-db
Offline method calls when reconnect doesn't authenticate
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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