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

Question: best way to advise users of successful update/inserts?

Open
#109 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.