Meteor-Community-Packages / Meteor-Community-Packages/ground-db
Data Transactions lost following Meteor Logout.
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
In our application we are trying to clear out our GroundDB record on logout and then refresh the web page. However, when this happens, we find that GroundDB is refilled (the data remains).
The Remove function is working (proven with console logs) but the 'remove' action seems to get rolled back or lost on a page reload, within a given time period.
It seems to be a timing issue.
The following function demonstrates the issue
myDB = new Ground.Collection('privateStuff', {connection: null});
function logoutAndClear()
{
// Clear Data
myDB.remove({});
```
// Log out of Meteor
Meteor.logout(function(err) {
// On successful logout, refresh page (don't re-load source from server)
location.reload(false); // If you remove this line - it works.
});
```
}
Contributor guide
Research direction
Start by reproducing the logoutAndClear function with the Ground.Collection, focusing on myDB.remove({}), Meteor.logout, and location.reload(false). Inspect how the remove action is persisted across logout and reload; done means the GroundDB records remain cleared after the page refresh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100