Page MenuHomePhabricator

[web] don't log out user when processing draft store ops fails
ClosedPublic

Authored by kamil on Dec 19 2023, 12:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 30, 12:20 AM
Unknown Object (File)
Sat, Jun 29, 9:17 PM
Unknown Object (File)
Wed, Jun 26, 2:12 AM
Unknown Object (File)
Tue, Jun 25, 6:10 AM
Unknown Object (File)
Mon, Jun 24, 9:45 PM
Unknown Object (File)
Mon, Jun 24, 12:20 AM
Unknown Object (File)
Wed, Jun 19, 11:19 PM
Unknown Object (File)
Wed, Jun 19, 11:14 PM
Subscribers

Details

Summary

Each time one character is typed operation with updated text is processed, so there is a high possibility that if something fails, those are draft operations.

When e.g. thread store operation fails we end with a corrupted state which could cause many issues, so it's safe to delete the database and log out the user.

When the draft operation fails at the worst case we lose the last character typed (if we stopped typing after that last character on which there was a failure), in other cases this does not influence app logic, so I think we can avoid logging to mitigate the user's frustration and at the same time keep alert with logging which could help debugging issues.

It will be better to make sure which operation exactly failed, but we wrap everything in one transaction so this doesn't make any change.

Test Plan

Throw when updating the draft and check if only the alert is shown without logging the user out

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 19 2023, 4:52 AM

I would guess that failing to process the reports also shouldn't cause clearing the db - if we fail the operation, we won't save a report, and by clearing the db we're making things a little worse.

This revision is now accepted and ready to land.Dec 19 2023, 6:21 AM
This revision was landed with ongoing or failed builds.Dec 19 2023, 9:07 AM
This revision was automatically updated to reflect the committed changes.