Skip to content

Fix another outfit-related CTD#347

Open
Quinn-Elara wants to merge 2 commits into
AlchemyViewer:developfrom
Quinn-Elara:outfit-fixes-a
Open

Fix another outfit-related CTD#347
Quinn-Elara wants to merge 2 commits into
AlchemyViewer:developfrom
Quinn-Elara:outfit-fixes-a

Conversation

@Quinn-Elara

Copy link
Copy Markdown
Contributor

Description

Defers notifying observers to run on the main thread. This fixes a CTD wherein glyph creation could happen outside of the main thread which would cause a CTD if uncaught.

Related Issues

  • Please link to a relevant GitHub issue for additional context.
    • Bug Fix: Link to an issue that includes reproduction steps and testing guidance.
    • Feature/Enhancement: Link to an issue with a write-up, rationale, and requirements.

Issue Link:


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Defers notifying observers to run on the main thread. Fixes a CTD wherein glyph creation could happen outside of the main thread which would cause a CTD if uncaught.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Quinn-Elara, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f01b74e2-df35-411b-89b2-ad0c4fc5e082

📥 Commits

Reviewing files that changed from the base of the PR and between bd86aed and 6c2da73.

📒 Files selected for processing (1)
  • indra/newview/llaisapi.cpp
📝 Walkthrough

Walkthrough

In AISUpdate::doUpdate(), three direct calls to gInventory.notifyObservers() are replaced with lambdas dispatched via LLAppViewer::instance()->postToMainCoro(...), deferring inventory observer notifications to execute on the main coroutine instead of the current call context.

Changes

Main Coro Dispatch for Inventory Notifications

Layer / File(s) Summary
Defer notifyObservers calls to main coroutine
indra/newview/llaisapi.cpp
Three call sites in AISUpdate::doUpdate() (category-creation backlog, item-creation backlog, final notification) replace direct gInventory.notifyObservers() calls with lambdas posted via LLAppViewer::instance()->postToMainCoro(...).

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: RyeMutt

Poem

A hop, a skip, a coro thread,
Notify calls now gently sped
To the main loop, safe and sound,
No more racing underground.
Thump-thump goes this rabbit's cheer! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the crash fix and main-thread notification change.
Description check ✅ Passed The description follows the template and includes the change summary, related issues section, checklist, and additional notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@indra/newview/llaisapi.cpp`:
- Around line 1748-1757: Throttle the deferred inventory notifications so they
are posted once per batch instead of once for every overflowed item. In the
inventory fetch/update path around gInventory.notifyObservers() and the
category-create path, add a guard or pending flag so repeated iterations while
mChangedItemIDs remains above MAX_UPDATE_BACKLOG do not queue duplicate
postToMainCoro callbacks. Make sure the same batching logic is applied
consistently in both places that currently defer notifyObservers().
- Around line 1683-1692: The backlog refresh logic in the inventory checks is
repeatedly posting notifyObservers() because deferred execution leaves
gInventory.getChangedIDs().size() above MAX_UPDATE_BACKLOG until the main loop
runs. Add a single pending-refresh/coalescing flag around the backlog paths in
llAisApi so only one deferred inventory refresh can be queued at a time, and
clear that flag when the posted callback runs and notifyObservers() completes.
Apply the same guard to both backlog checks in llAisApi to preserve throttling
and prevent gMainloopWork from being flooded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5873a2ea-9cbc-418c-a777-28e71e0a6d75

📥 Commits

Reviewing files that changed from the base of the PR and between 341d3c4 and bd86aed.

📒 Files selected for processing (1)
  • indra/newview/llaisapi.cpp

Comment thread indra/newview/llaisapi.cpp
Comment thread indra/newview/llaisapi.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant