[iOS] Fix ShouldTriggerHelpUI Being Called Multiple Times [chromium/src : main]

0 views
Skip to first unread message

Joemer Ramos (Gerrit)

unread,
Dec 26, 2025, 10:16:13 AM (yesterday) Dec 26
to Joemer Ramos, AyeAye, Robbie Gibson, Adam Arcaro, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, christia...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Adam Arcaro and Robbie Gibson

Joemer Ramos voted and added 3 comments

Votes added by Joemer Ramos

Commit-Queue+1

3 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Joemer Ramos . resolved

I found the issue, during migration, one of the timer variables weren't being used properly. This **doesn't** break M144 but we do need to cherry pick this into M145.

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 426, Patchset 1: weak_ptr_factory_.InvalidateWeakPtrs();
Robbie Gibson . resolved

I see a lot of uses of the `weak_ptr_factory_` in this class. This won't mess up any other uses?

Joemer Ramos

@ada...@google.com do you have any thoughts here? I thought about this too. Is there a way around this? Maybe I should create a separate weak pointer factory for `AskGeminiChip`?

Joemer Ramos

Disregard

Line 566, Patchset 1: if (previous_main_frame_url_ != main_frame_url) {
Adam Arcaro . resolved

IIUC, your theory is that this callback is occurring multiple times, which calls the FET multiple times as a result. Is that right?

This condition is meant to handle that, which would return early if the URL has changed since the request was made

Joemer Ramos

`previous_main_frame_url_ = current_url;` only happens in `DidFinishNavigation()`. Is it possible that this condition is not doing what we want? i.e. we wouldn't return early if the eligible site that the user navigates to doesn't reach a state which would call `DidFinishNavigation()`. So:

1. User goes to eligible site A
2. DidFinishNavigation is called
3. Callback A is kicked off
4. User goes to eligible site B but hasn't finished navigating yet.
5. Callback A returns (passing the URL early return check)
6. FET trigger happens and IPH is shown
7. Callback B is kicked off
8. Callback B returns (passing the URL early return check)
9. FET trigger happens and hits DCHECK as the IPH has not dismissed

Something along these lines + what I commented [here](https://chromium-review.googlesource.com/c/chromium/src/+/7301235/comments/f10df804_13bcbd13) in a discussion with Robbie. I suppose that with Robbie's comment of how this DCHECK gets hit, maybe we can check if the promo timer isn't null which implies that the chip is currently showing WDYT? I think in general, we need to avoid this:
```
And kIPHiOSGeminiContextualCueChip's FET rules have nothing that
would prevent a 2nd call from returning false (i.e there's no session_rate
rule, the trigger rule allows for multiple displays in 1 day).

So it's your responsibility to make sure that you don't
call ShouldTriggerHelpUI while the IPH is currently being displayed.
```

Joemer Ramos

Disregard

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Arcaro
  • Robbie Gibson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I84edfd7e6d578d6b0d51b26e75fefc9e5ee27c11
Gerrit-Change-Number: 7301235
Gerrit-PatchSet: 3
Gerrit-Owner: Joemer Ramos <joeme...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
Gerrit-Reviewer: Robbie Gibson <rkgi...@google.com>
Gerrit-Attention: Robbie Gibson <rkgi...@google.com>
Gerrit-Attention: Adam Arcaro <ada...@google.com>
Gerrit-Comment-Date: Fri, 26 Dec 2025 15:16:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Joemer Ramos <joeme...@google.com>
Comment-In-Reply-To: Robbie Gibson <rkgi...@google.com>
Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Joemer Ramos (Gerrit)

unread,
Dec 26, 2025, 10:16:47 AM (yesterday) Dec 26
to Joemer Ramos, AyeAye, Robbie Gibson, Adam Arcaro, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, christia...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Adam Arcaro and Robbie Gibson

Joemer Ramos added 1 comment

Patchset-level comments
Joemer Ramos . resolved

I found the issue, during migration, one of the timer variables weren't being used properly. This **doesn't** break M144 but we do need to cherry pick this into M145.

Joemer Ramos

Nevermind, M145 branches Jan 12, so this can just normally roll in

Gerrit-Comment-Date: Fri, 26 Dec 2025 15:16:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joemer Ramos <joeme...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages