Skip to content

Change getFullPaths candidate language from "priority" to "preference"#2235

Open
lawrence-forooghian wants to merge 1 commit into
mainfrom
getFullPaths-preference-not-priority
Open

Change getFullPaths candidate language from "priority" to "preference"#2235
lawrence-forooghian wants to merge 1 commit into
mainfrom
getFullPaths-preference-not-priority

Conversation

@lawrence-forooghian
Copy link
Copy Markdown
Collaborator

@lawrence-forooghian lawrence-forooghian commented Jun 1, 2026

"Priority" implies something to do with importance; instead, use the "preference" language that I used in spec point RTO24b2a.

Summary by CodeRabbit

  • Improvements
    • Enhanced path subscription event routing to prioritize more direct paths when multiple subscription paths match an update event.
    • Emitted path events now favor the most relevant (shorter/more direct) subscription path, improving update delivery accuracy and reducing ambiguous matches.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 94b2d703-77d9-4836-b4b8-44e7abf47ff5

📥 Commits

Reviewing files that changed from the base of the PR and between 733c510 and c47fafb.

📒 Files selected for processing (2)
  • src/plugins/liveobjects/liveobject.ts
  • src/plugins/liveobjects/pathobjectsubscriptionregister.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/plugins/liveobjects/pathobjectsubscriptionregister.ts

Walkthrough

The PR renames PathEvent's candidate-paths field to preferenceOrderedCandidatePaths, updates LiveObject to build preference-ordered candidate lists (including added map-key candidates), and updates the subscription register to choose the first matching candidate from that preference-ordered list.

Changes

Path candidate ordering refactor: priority-ordered to preference-ordered semantics

Layer / File(s) Summary
PathEvent contract update
src/plugins/liveobjects/pathobjectsubscriptionregister.ts
The PathEvent interface field priorityOrderedCandidatePaths is renamed to preferenceOrderedCandidatePaths and documentation updated to reflect preference-ordered semantics.
LiveObject preference-ordered path construction
src/plugins/liveobjects/liveobject.ts
_notifyPathSubscriptions initializes preferenceOrderedCandidatePaths and, for LiveMapUpdate, appends updated-key candidate paths after the direct pathToThis, then constructs PathEvent with preferenceOrderedCandidatePaths.
PathObjectSubscriptionRegister preference-ordered dispatch
src/plugins/liveobjects/pathobjectsubscriptionregister.ts
notifyPathEvent iterates event.preferenceOrderedCandidatePaths to find and surface the first covered subscription candidate as the chosen event.object for listeners.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ably/ably-js#2223: Refactors path-based PathEvent candidate selection in a similar area, coordinating dispatcher logic to pick the first matching path from ordered candidates.

Suggested reviewers

  • VeskeR
  • mschristensen
  • sacOO7

🐰 I hopped through paths both short and long,
Preference now guides which match belongs,
From LiveObject's list to the register's choice,
First fitting path gets the listener's voice,
A small shuffle — and the routing sings along.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: renaming terminology from 'priority' to 'preference' in the candidate path ordering logic across LiveObject and PathEvent implementations.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch getFullPaths-preference-not-priority

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 and usage tips.

@github-actions github-actions Bot temporarily deployed to staging/pull/2235/bundle-report June 1, 2026 16:47 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/2235/typedoc June 1, 2026 16:47 Inactive
"Priority" implies something to do with importance; instead, use the
"preference" language that I used in spec point RTO24b2a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant