Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace - Endless loading after delete the Workspace #7361

Closed
kbecciv opened this issue Jan 21, 2022 · 11 comments
Closed

Workspace - Endless loading after delete the Workspace #7361

kbecciv opened this issue Jan 21, 2022 · 11 comments
Assignees

Comments

@kbecciv
Copy link

kbecciv commented Jan 21, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Launch the app
  2. Log in with any account
  3. Select any Workspace
  4. Select "Delete Workspace"

Expected Result:

The Workspace deleted successfully

Actual Result:

Endless loading after delete the Workspace

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.1.32. 0

Reproducible in staging?: Yes

Reproducible in production?: Yes

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug5416538_Scroll_21.01.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

View all open jobs on GitHub

@MelvinBot
Copy link

Triggered auto assignment to @joelbettner (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@neil-marcellini
Copy link
Contributor

I've encountered this and I get the error [Onyx] Out of storage after deleting the workspace.

@neil-marcellini
Copy link
Contributor

I would like to work on this one if possible.

@kidroca
Copy link
Contributor

kidroca commented Jan 21, 2022

It's probably not an out of storage error
We just throw that for any storage error that happens (in Onyx)

I think the actual problem is we're calling Onyx.set with null and AsyncStorage rejects that

We should either

  • call Onyx delete/remove
  • Or handle null in Onyx.set and call delete internally

@kidroca
Copy link
Contributor

kidroca commented Jan 21, 2022

This must be an update to AsyncStorage that happened recently as before it was working with setting a key to null

Or maybe it only happens for multi set...

But I'm certain I saw AsyncStorage complaining for adding a null value yesterday

@kidroca
Copy link
Contributor

kidroca commented Jan 22, 2022

I'm sorry it seems I've introduced this bug here: https://github.com/Expensify/react-native-onyx/blob/41c0ee3fae92f644463d3d95fd510eb0142f950c/lib/storage/providers/AsyncStorage.js#L9-L21

I thought I had this covered in the storage provider unit tests...

I think we can just stringify everything including null (that's the orginal behavior)
Stringifying undefined doesn't return a string but undefined anyway

Here we see that AsyncStorage would throw an error for a null value: https://github.com/react-native-async-storage/async-storage/blob/a3e9537e775147420bc3fcdc26b21efcfb6fada1/src/AsyncStorage.native.js#L60-L63

We do have a unit test verifying using set with null works, but it passes because the AsyncStorage mock does not throw an error when you try to set null

@kidroca
Copy link
Contributor

kidroca commented Jan 22, 2022

Opened a PR to fix Onyx: Expensify/react-native-onyx#117

@kidroca
Copy link
Contributor

kidroca commented Jan 24, 2022

The Onyx PR was merged, updating App's package should be enough to fix the issue

@kidroca
Copy link
Contributor

kidroca commented Jan 24, 2022

Submitted a PR to update Onyx and tested all platforms: #7370

@joelbettner
Copy link
Contributor

@kidroca I'm going to close this issue. Feel free to re-open if need be.

@murataka
Copy link

murataka commented Feb 7, 2022

It's probably not an out of storage error
We just throw that for any storage error that happens (in Onyx)

@kidroca , I was able to fill the OnyxDB, and everything, including chrome crashed, chrome also has gone to eternity. this causes many issues ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants