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 crash in AI Chat when conversation is unassociated from page content #26495

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

petemill
Copy link
Member

@petemill petemill commented Nov 11, 2024

The associated content wasn't notified in all cases that the conversation was no longer associated with it and would not be notified of destruction. It kept a reference to the conversation and used it after destruction.

Fix brave/brave-browser#42091
Fix brave/brave-browser#42092

Also removes a NOTREACHED_IN_MIGRATION from the same file.
Fix brave/brave-browser#42089

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

STR in brave/brave-browser#42092

Copy link
Member

@SergeyZhukovsky SergeyZhukovsky left a comment

Choose a reason for hiding this comment

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

++

@petemill petemill force-pushed the ai-chat-crash-content-delegate branch from 849427b to 699173e Compare November 12, 2024 07:26
@petemill petemill enabled auto-merge (squash) November 12, 2024 08:02
@petemill petemill enabled auto-merge (squash) November 12, 2024 08:03
@petemill petemill merged commit a0eb552 into master Nov 12, 2024
17 checks passed
@petemill petemill deleted the ai-chat-crash-content-delegate branch November 12, 2024 08:24
@github-actions github-actions bot added this to the 1.75.x - Nightly milestone Nov 12, 2024
@brave-builds
Copy link
Collaborator

Released in v1.75.12

petemill added a commit that referenced this pull request Nov 12, 2024
…ent (#26495)

* AIChat ConversationHandler remove NOTREACHED_IN_MIGRATION

* ConversationHandler notifies AssociatedContentDelegate when conversation is not associated
petemill added a commit that referenced this pull request Nov 12, 2024
…ent (#26495)

* AIChat ConversationHandler remove NOTREACHED_IN_MIGRATION

* ConversationHandler notifies AssociatedContentDelegate when conversation is not associated
@kjozwiak
Copy link
Member

kjozwiak commented Nov 12, 2024

Verification PASSED on Win x64 using the following build(s):

Brave | 1.75.13 Chromium: 131.0.6778.39 (Official Build) nightly (64-bit)
-- | --
Revision | 71c03ef2ff1496bd28e5e74715c252941a135b1a
OS | Windows 11 Version 24H2 (Build 26100.2161)

Using 1.75.11 Chromium: 131.0.6778.39 and the STR/Cases outlined via brave/brave-browser#42092 (comment), reproduced the crashes as per the following:

* Crash #1 (Test Case #1) - 46d21800-e4c5-e10c-0000-000000000000
* Crash #2 (Test Case #2) - a5d31800-e4c5-e10c-0000-000000000000

Using the same STR/Cases outlined via brave/brave-browser#42092 (comment) which were used above to reproduce the two crashes, ensured that Brave wasn't crashing with 1.75.13 Chromium: 131.0.6778.39 which has the above fix.


Verification PASSED on Pixel 6 running Android 15 using the following build(s):

Brave | 1.75.13 Chromium: 131.0.6778.39 (Official Build) canary (64-bit)
--- | ---
Revision | 71c03ef2ff1496bd28e5e74715c252941a135b1a
OS | Android 15; Build/AP41.240925.009; 35; REL

Using 1.75.11 Chromium: 131.0.6778.39 and the STR/Cases outlined via brave/brave-browser#42092 (comment), reproduced the crashes as per the following:

* Crash #1 (Test Case #1) - e2d61800-e4c5-e10c-0000-000000000000
* Crash #2 (Test Case #2) - 3fd71800-e4c5-e10c-0000-000000000000

Using the same STR/Cases outlined via brave/brave-browser#42092 (comment) which were used above to reproduce the two crashes, ensured that Brave wasn't crashing with 1.75.13 Chromium: 131.0.6778.39 which has the above fix.

kjozwiak pushed a commit that referenced this pull request Nov 12, 2024
…from page content (#26495) (#26513)

Fix crash in AI Chat when conversation is unassociated from page content (#26495)

* AIChat ConversationHandler remove NOTREACHED_IN_MIGRATION

* ConversationHandler notifies AssociatedContentDelegate when conversation is not associated
kjozwiak pushed a commit that referenced this pull request Nov 12, 2024
…from page content (#26495) (#26512)

Fix crash in AI Chat when conversation is unassociated from page content (#26495)

* AIChat ConversationHandler remove NOTREACHED_IN_MIGRATION

* ConversationHandler notifies AssociatedContentDelegate when conversation is not associated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants