-
Notifications
You must be signed in to change notification settings - Fork 120
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
Prevent view ID conflict/crash by multiplying each generated view ID by a prime number #2588
Conversation
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 but I do have some questions.
- Do we need to do it this way at all? The other task fragments don't call
add
and instead use bindings (see e.g. MultipleChoiceTaskFragment). - If we need to use
add
here, can we either drop the LinearLayout container or define it directly in the layout for the fragment?add
claims that the ID is optional and using an argument of 0 will just add it without using a parent—can we use the existing build-time ID of the general task fragment parent instead, to avoid this problem entirely?
Nice sleuthing, @sufyanAbbasi ! Looks like some checks are failing? |
Thank you so much for the alternatives! I have a strong feeling these would actually work, now understanding better what the root cause of it is. Unfortunately, I'm under time constraints and will take me a little bit to investigate and verify that the fix actually works. Can I schedule some time with you to peer program on this?
I can't tell if these are just transient, I'll try rerunning. |
@scolsen and I had a chance to meet, we determined that due to the nature of needing to render a view to return from Hence, we have decided to just go for this solution for now with comment. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2588 +/- ##
=========================================
Coverage 55.77% 55.77%
Complexity 1317 1317
=========================================
Files 317 317
Lines 7130 7130
Branches 886 886
=========================================
Hits 3977 3977
Misses 2672 2672
Partials 481 481
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Fixes #2493
generateViewId()
producing an ID number that is the same as an ID number assigned to a View in the GoogleMapsFragment.generateViewId()
is not thread safe whenGoogleMapsFragment
views are also being produced at the same time.npm run test:e2e:create
inground-platform
to create a survey to repro breakage.npm run start:local
by modifying package.json to usetest/data-create
@gino-m, @shobhitagarwal1612 PTAL!