-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: implement dynamic resizing array buffers #54656
feat: implement dynamic resizing array buffers #54656
Conversation
…-resizing-array-buffers
We need to use the dynamic array buffer in the utils as well as it could happen that we try to write to an already full array buffer otherwise
@allgandalf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Unfortunately I didn't had time to record videos for all platforms 🙇♂️ |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-01-07.at.3.18.23.PM.movAndroid: mWeb ChromeScreen.Recording.2025-01-07.at.3.24.22.PM.moviOS: NativeScreen.Recording.2025-01-07.at.3.07.43.PM.moviOS: mWeb SafariScreen.Recording.2025-01-07.at.3.13.43.PM.movMacOS: Chrome / SafariScreen.Recording.2025-01-07.at.2.51.50.PM.movMacOS: DesktopScreen.Recording.2025-01-07.at.2.56.06.PM.mov |
@hannojg is this ready for review ? |
Yeah sorry, was just pushing one little perf optimization |
No worries sirrr 🙇 |
almost done with testing, I will complete checklist tomorrow |
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.
Tests well and LGTM!
There seems to be something funky going on with Jest Unit Tests / test (job 2)... The first time this was running (here) it ran for 6 HOURS 🤣 and had to be manually cancelled... I just retried and it has been running for 13 minutes, stuck on the same spot 🤔 |
@hannojg would you be able to see if that test runs fine locally? |
bump @hannojg 🙇 |
…-resizing-array-buffers
Hm, after merging with main it seems to be stuck again (can you cancel please?). |
I had a test case that was trying to use negative indexes for the array buffer. before I added boundary checks for it, but later felt that it was complicating the code too much. Also because the If you tried to set values at negative indexes you would run into an endless loop, thus the tests never finished. Its fixed now! |
Nice find & fix @hannojg ! Do you think we need to retest this on |
Should be safe! 😇 |
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.
Looking great!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.85-0 🚀
|
3 similar comments
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.85-0 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.85-0 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.85-0 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.0.85-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.85-4 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.85-4 🚀
|
Explanation of Change
The search is represented as a big string which gets converted to a purely numerical representation. That representation is an ArrayBuffer. Earlier, the ArrayBuffer had a fixed length of
400,000
chars. Meaning that if the user's search string was larger than that items may not be found.This PR fixes this by adding dynamic array buffer resizing. The PR adds two things:
The resizing can be pretty fast, this is from my Mac in Chrome:
Fixed Issues
$ #54594
PROPOSAL: #54594 (comment)
Tests
Offline tests
QA Steps
Precondition:
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.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
CleanShot.2024-12-30.at.17.24.29.mp4
Android: mWeb Chrome
CleanShot.2024-12-30.at.17.24.29.mp4
iOS: Native
CleanShot.2024-12-30.at.17.24.29.mp4
iOS: mWeb Safari
CleanShot.2024-12-30.at.17.24.29.mp4
MacOS: Chrome / Safari
CleanShot.2024-12-30.at.17.24.29.mp4
MacOS: Desktop
CleanShot.2024-12-30.at.17.24.29.mp4