Merge `navigations` and `preRegisteredNavigationIds` maps into one in NavigationManager
Categories
(Remote Protocol :: WebDriver BiDi, task, P3)
Tracking
(firefox132 fixed)
| Tracking | Status | |
|---|---|---|
| firefox132 | --- | fixed |
People
(Reporter: Sasha, Assigned: ldebeasi, Mentored)
References
Details
(Whiteboard: [lang=js][webdriver:m12][webdriver:external][webdriver:relnote])
Attachments
(1 file)
In the scope of bug 1846601 in NavigationManager we've introduced a new map with navigable id as a key and navigation info as a value, it's similar to the existing map (preRegisteredNavigationIds) to pre-register navigations which contains the same data but is cleaned up when events are sent. So we could merge these two maps into one, and replace finished property with the property state with 3 different values registered, started and finished. The name of the map should stay navigations.
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
Hi there! I am interested in contributing a patch for this. I have a couple questions:
- Am I correct in my understanding that there should be no behavior changes as a result of this?
- When
getOrCreateNavigationIdis called, we check#preRegisteredNavigationIdsand delete an entry from it if it is found. The navigation ID from that entry is then typically used to add an entry to#navigations. What should happen in this case? Should I replace#preRegisteredNavigationIdswith#navigationseven though the entry will potentially be added back to#navigations?
| Reporter | ||
Comment 2•1 year ago
|
||
Hi Liam!
- Am I correct in my understanding that there should be no behavior changes as a result of this?
Yes, you're correct, this is supposed to be just a refactoring and behavior should not change.
- When
getOrCreateNavigationIdis called, we check#preRegisteredNavigationIdsand delete an entry from it if it is found. The navigation ID from that entry is then typically used to add an entry to#navigations. What should happen in this case? Should I replace#preRegisteredNavigationIdswith#navigationseven though the entry will potentially be added back to#navigations?
You should replace the #preRegisteredNavigationIds with #navigations (meaning add an entry to the #navigations map with a new field state with the value registered) but you shouldn't remove the entry here anymore, and then in this place instead of creating a new entry you should just update the existing entry by changing the state field to the value started. Does it make sense? Please let me know if it doesn't :)
If you have more questions, I'm happy to answer! Also, if you want to get a bit quicker feedback, we have a matrix channel, you can join and ask there.
| Assignee | ||
Comment 3•1 year ago
|
||
Thank you! I started work on this change, and I have two follow up questions:
- You mentioned I should update the existing entry here to change the
statefield tostarted. My understanding ofnotifyFragmentNavigatedis that this runs after the fragment has already navigated. Should I be updating this tofinishedinstead? - While running tests I noticed that these checks are now passing where they were failing prior to my change. Is that ok?
| Reporter | ||
Comment 4•1 year ago
|
||
- You mentioned I should update the existing entry here to change the
statefield tostarted. My understanding ofnotifyFragmentNavigatedis that this runs after the fragment has already navigated. Should I be updating this tofinishedinstead?
Ah, yes, you're right! In this case, you should update it to finished.
- While running tests I noticed that these checks are now passing where they were failing prior to my change. Is that ok?
Hm... No, I think it should keep on failing, does this test still pass?
| Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 6•1 year ago
|
||
Good catch! My local project was outdated. Looks like the tests are working correctly on my end now after grabbing the latest changes.
Comment 8•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Updated•1 year ago
|
Description
•