Meteor-Community-Packages / Meteor-Community-Packages/ground-db
Question: best way to advise users of successful update/inserts?
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Hello, thank you for your excellent package.
My app is using autoform quite extensively to provide document insert/update functionality. I added GroundMeteor/db and it works beautifully. However, I noticed that the success messages I had coded only appear to the user after the app had reconnected to the server the changes have been synced. I'm doing collection inserts/updates via allow/deny rules rather than server methods.
This is the code I was using to provide feedback on update/insert success:
```
AutoForm.addHooks('updateDocument',
{
onSuccess: function(formType, result) {
toastr.success('Changes saved.');
},
}
);
```
I've also tried Collection Hooks but it exhibits the exact same symptom: the user is informed of multiple update/insert success messages only after the app has reconnected to the server:
```
tasks.after.update(function(userId, doc, fieldNames, modifier, options){
if (Meteor.isClient){
toastr.success("Update sucess!");
}
});
```
Would someone be able to advise me how I should be handling this?
Thanks.
Contributor guide
Research direction
Start with the AutoForm.addHooks('updateDocument') onSuccess callback and the tasks.after.update Collection Hook shown in the issue. Reproduce an insert or update while GroundDB is offline, then reconnect and compare when each success message appears. Done means identifying the supported handling for immediate feedback or documenting a confirmed fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100