Page MenuHomePhabricator

[native] Add alerts to `SQLiteContextProvider` with exception info
ClosedPublic

Authored by atul on Oct 12 2022, 5:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 11:36 AM
Unknown Object (File)
Mon, Nov 25, 10:36 PM
Unknown Object (File)
Mon, Nov 25, 10:36 PM
Unknown Object (File)
Sun, Nov 24, 2:47 PM
Unknown Object (File)
Sun, Nov 24, 2:47 PM
Unknown Object (File)
Sun, Nov 24, 2:47 PM
Unknown Object (File)
Sun, Nov 24, 12:38 PM
Unknown Object (File)
Sun, Nov 24, 12:38 PM
Subscribers

Details

Summary

Add additional "logging" (via Alert.alert(...)) to provide user with information about potential issues with setting of threadStore/messageStore or with fetchNewCookieFromNativeCredentials. The logic/behavior should be equivalent to before.

Test Plan

NA, careful reading

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Oct 12 2022, 5:45 PM
ashoat requested changes to this revision.Oct 13 2022, 6:17 AM
ashoat added a subscriber: ashoat.
ashoat added inline comments.
native/data/sqlite-context-provider.js
52 ↗(On Diff #17536)

Is this meant to be landed, or just patched in before a release?

  1. If it's meant to be landed, I think we should only show the alerts if __DEV__ or isStaff
  2. If it's meant to be patched in before a release, it would be good to mention that in the diff description somewhere or a comment
53 ↗(On Diff #17536)

I don't think you can just put an exception inline like this... don't you need to use getMessageForException or something?

65 ↗(On Diff #17536)
  1. Probably need getMessageForException here
  2. It seems like there's a scenario where the loading screen just ends up spinning indefinitely here. Instead, should we call ExitApp.exitApp() here? Or if it's just an internal build, we could indicate to the user they should kill the app, or we could set up the Alert so when it's acknowledged it kills the app (eg. there could be only one button on the alert and it could say "kill app" or something)
This revision now requires changes to proceed.Oct 13 2022, 6:17 AM
atul planned changes to this revision.Oct 13 2022, 7:16 AM
atul added inline comments.
native/data/sqlite-context-provider.js
52 ↗(On Diff #17536)

It's meant to be landed, want to minimize the number of temporary "changes before release."

I figured it would be fine to provide these alerts even in a general release to help surface any issues, but I'll update so they only apply to __DEV__ or staff.

53 ↗(On Diff #17536)

Here's what I saw locally:

1c5ab2.png (916×2 px, 219 KB)

2aec57.png (634×714 px, 78 KB)

I'll modify to use getMessageForException for consistency with rest of the codebase

65 ↗(On Diff #17536)
  1. Will update
  2. Since this will be internal only, will add a note to the alert that the app should be killed.

address feedback

  1. limit alerts to __DEV__ or isStaff
  2. use getMessageForException(...)
  3. notify user to exit app on fetchNewCookieFromNativeCredentials(...) failure

Please address feedback before landing

native/data/sqlite-context-provider.js
81 ↗(On Diff #17543)

In the else condition here let's call ExitApp.exitApp() so that the app doesn't hang indefinitely for users

This revision is now accepted and ready to land.Oct 13 2022, 10:00 AM

rebase before addressing feedback

atul marked an inline comment as done.

address feedback

native/data/sqlite-context-provider.js
81 ↗(On Diff #17543)

👍🏽

This revision was landed with ongoing or failed builds.Oct 13 2022, 12:53 PM
This revision was automatically updated to reflect the committed changes.