Replace cal.createAdapter-based calendar observers with explicit calIObserver objects#67
Open
DeBaschdi wants to merge 1 commit intothunderbird:mainfrom
Open
Replace cal.createAdapter-based calendar observers with explicit calIObserver objects#67DeBaschdi wants to merge 1 commit intothunderbird:mainfrom
DeBaschdi wants to merge 1 commit intothunderbird:mainfrom
Conversation
Replace cal.createAdapter-based calendar observers with explicit calIObserver objects ## Summary This replaces `cal.createAdapter(Ci.calIObserver, ...)` usage in the calendar experiment with explicit `calIObserver` objects using: ```js QueryInterface: ChromeUtils.generateQI(["calIObserver"])
Member
|
@mkmelin can you give this a quick look? I believe you removed createAdapter in core code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #66
Summary
This PR replaces
cal.createAdapter(Ci.calIObserver, ...)usage in the calendar experiment with explicitcalIObserverobjects using:Problem
On newer Thunderbird releases,
cal.createAdapteris no longer available.That breaks listener registration in the calendar experiment and prevents these experiment events from being registered correctly:
calendar.items.onCreatedcalendar.items.onUpdatedcalendar.items.onRemovedcalendar.calendars.onUpdatedCause
The experiment currently relies on:
for internal observer creation.
When that helper is unavailable, observer registration fails before
cal.manager.addCalendarObserver(observer)can succeed.Fix
Replace the removed helper usage with explicit
calIObserverobjects.The patch adds small local helpers which provide:
QueryInterface: ChromeUtils.generateQI(["calIObserver"])This keeps the public experiment API unchanged and only updates internal observer construction.
Affected files
calendar/experiments/calendar/parent/ext-calendar-items.jscalendar/experiments/calendar/parent/ext-calendar-calendars.jsVerification
Verified manually on:
After the patch:
calendar.items.onCreatedworkscalendar.items.onUpdatedworkscalendar.items.onRemovedworkscalendar.calendars.onUpdatedworkscal.createAdapter is not a functionruntime errors are goneNotes
This is a compatibility fix only.
It does not change the public experiment API surface or semantics.