-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat: fallback to NoopProvider if we run into OOM [2/3] #483
feat: fallback to NoopProvider if we run into OOM [2/3] #483
Conversation
@danieldoglas @tgolen I can't add you as reviewers, so just tagging you here 👀 The PR is hard to review now, because it's based on my changes in first PR, but when first PR is merged, then all changes that belongs to first PR will be automatically cleaned up from this PR (and we will have less files to review). |
5657066
to
9deedf3
Compare
@danieldoglas @tgolen tagging you again - this PR is ready for review 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the ping! I was waiting for the rebase.
} | ||
} | ||
|
||
reject(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't every look like anything is using this rejection. If so, maybe it should be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgolen I think no, it's better to have it here
The function tryOrDegradePerformance
just acts as an interceptor - it simply executes the function and in case of a specific exception just substitutes a provider. And when we develop such generic functions it's important to propagate exceptions further.
And this function keeps full backward compatibility - if getItem
or any other function would throw exception before, then it would be thrown further (and potentially we may have a code that handles these errors). So I'd like to keep this line and propagate exceptions and don't silently swallow them.
@tgolen may I ask you to review it again? 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ae2aee1
to
956193b
Compare
Good point @blazejkustra @tgolen will be happy to hear your thoughts 😊 |
I think it's OK to remove at this point. It has a little bit of complex history. We used to use it, but it was never fully implemented either. Expensify/App#26304 Let's just kill it 🔪 |
Do I have a green light to remove |
Yep! |
Actually, no... sorry. I should have checked App first. It's still being referenced in App. So we need to remove those first. |
Details
A follow up for #439
This is a second PR in chain of multiple PRs. In this PR I added:
name
property to all providers (used in logger if we ran into OOM);NoopProvider
that is used as a fallback one when OOM happens;tryOrDegradePerformance
function that attempt to perform operation and in case of specific error substitutes the storage to a fallback one;Related Issues
Expensify/App#29403
Automated Tests
This PR changes the way we use the storage but the functionality of the library to the outer world is the same. Therefore no new tests were added.
Manual Tests
Verify that no flows and functionality were broken by the changes. Check for console errors regarding Onyx.
Author Checklist
### Related Issues
section aboveTests
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop