Closed SCdF closed 5 years ago
Admin users are more complicated, since all their interactions go straight to the net.
All admin users' interactions go through pouch, so you may not need special handling for them.
All admin users' interactions go through pouch, so you may not need special handling for them.
Ideally there would be a Pouch hook where we say something like:
pouchDbInstance.on('error', function(err) {
if (err.status === 401) {
return Session.redirectToLogin();
}
});
Unfortunately the only ones I've found documentation for is created and destroyed (ie for changes to documents), which isn't really helpful here. I'm too new to Javascript to know if there is a way we can just hook into the event model regardless of what Pouch wants us to do.
Point of pedantry: I think create
and destroy
events refer to databases rather than docs: http://pouchdb.com/api.html#events
Yep sorry you're right. Which is even weirder, since you'd think you would care even less about those events.
hi frand @browndav, please triage before the end of this sprint. :parrot_conga::parrot_conga::parrot_conga:
Related: #3299 #3254
This appears valuable; removing "needs triage" label and placing in deprioritized mobile app features milestone.
This should be fixed by #3919 - adding to AT to make sure.
Fixed by #3919 - with improvement suggestions in #5772 .
See #1931 .
The above ticket can solve issues with Pouch users because there are only so many places they touch the network (some boot strapping, pouch replication etc).
Admin users are more complicated, since all their interactions go straight to the net.
To generically solve this we should create a heartbeat that pings a resource that is known to be tiny and behind auth, and if we ever get a 401 back redirect to the log in page.