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

Fix comment on #5201 #5209

Merged
merged 4 commits into from
Mar 27, 2025

Conversation

zhongqiliang
Copy link
Contributor

@zhongqiliang zhongqiliang commented Mar 26, 2025

  1. Corrects duplicate Mojo listener registration by removing the RemoteAddListener() call from setOndeeplink(). Registration logic is now correctly handled only within the AddedEventListener(), which is triggered by both property assignment and addEventListener.
  2. Using the DEFINE_ATTRIBUTE_EVENT_LISTENER macro to replace ondeeplink/setOndeeplink methods.
  3. Renaming EnsureReceiverIsBound to EnsureRemoteIsBound, it is for remote_h5vcc_runtime_.
  4. Renaming receiver_ to listener_receiver_ and adding the listener_registered_ flag for tracking AddListener 's state.

https://screenshot.googleplex.com/8jeU7xBYSLq2gLN is the proof of no app crash for multiple registration of the callbacks.

b/374147993

@zhongqiliang zhongqiliang requested a review from a team as a code owner March 26, 2025 23:46
@zhongqiliang zhongqiliang requested review from dahlstrom-g and yell0wd0g and removed request for dahlstrom-g March 26, 2025 23:46
@kaidokert kaidokert changed the title Fix comment on https://github.com/youtube/cobalt/pull/5201 Fix comment on #5201 Mar 27, 2025
@zhongqiliang zhongqiliang force-pushed the warm_deep_link_fix_comment branch from af4ba19 to 64257eb Compare March 27, 2025 05:21
@zhongqiliang zhongqiliang requested a review from yell0wd0g March 27, 2025 05:22
@zhongqiliang zhongqiliang force-pushed the warm_deep_link_fix_comment branch from 64257eb to 5d16dba Compare March 27, 2025 05:25
@andrewsavage1
Copy link
Contributor

LGTM other than my one open comment, seems to address Miguel's concerns too but I'll let him review

@andrewsavage1
Copy link
Contributor

@yell0wd0g I updated the conditions slightly in b6ad7da, ptal

@andrewsavage1
Copy link
Contributor

Tested this locally and it seems to work, though Sergei wants to do a bit more testing—will submit in a few

Copy link
Contributor

@yell0wd0g yell0wd0g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the comments addressed.

@andrewsavage1
Copy link
Contributor

Tested locally after latest changes and seems to work

@andrewsavage1 andrewsavage1 enabled auto-merge (squash) March 27, 2025 17:32
@andrewsavage1 andrewsavage1 merged commit f9000af into youtube:main Mar 27, 2025
151 checks passed
@andrewsavage1 andrewsavage1 added the cp-26.android Cherry Pick to the 26.android branch label Mar 27, 2025
cobalt-github-releaser-bot pushed a commit that referenced this pull request Mar 27, 2025
1. Corrects duplicate Mojo listener registration by removing the
`RemoteAddListener()` call from `setOndeeplink()`. Registration logic is
now correctly handled only within the `AddedEventListener()`, which is
triggered by both property assignment and `addEventListener`.
2. Using the `DEFINE_ATTRIBUTE_EVENT_LISTENER` macro to replace
`ondeeplink`/`setOndeeplink` methods.
3. Renaming `EnsureReceiverIsBound` to `EnsureRemoteIsBound`, it is for
remote_h5vcc_runtime_.
4. Renaming `receiver_` to `listener_receiver_` and adding the
`listener_registered_` flag for tracking AddListener 's state.

https://screenshot.googleplex.com/8jeU7xBYSLq2gLN is the proof of no app
crash for multiple registration of the callbacks.

b/374147993

---------

Co-authored-by: Colin Liang <[email protected]>
Co-authored-by: Andrew Savage <[email protected]>
(cherry picked from commit f9000af)
andrewsavage1 pushed a commit that referenced this pull request Mar 27, 2025
Refer to the original PR: #5209

1. Corrects duplicate Mojo listener registration by removing the
`RemoteAddListener()` call from `setOndeeplink()`. Registration logic is
now correctly handled only within the `AddedEventListener()`, which is
triggered by both property assignment and `addEventListener`.
2. Using the `DEFINE_ATTRIBUTE_EVENT_LISTENER` macro to replace
`ondeeplink`/`setOndeeplink` methods.
3. Renaming `EnsureReceiverIsBound` to `EnsureRemoteIsBound`, it is for
remote_h5vcc_runtime_.
4. Renaming `receiver_` to `listener_receiver_` and adding the
`listener_registered_` flag for tracking AddListener 's state.

https://screenshot.googleplex.com/8jeU7xBYSLq2gLN is the proof of no app
crash for multiple registration of the callbacks.

b/374147993

Co-authored-by: Colin Liang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cp-26.android Cherry Pick to the 26.android branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants