Skip to content

fix(recent-list): prefer conference URL on CONFERENCE_WILL_LEAVE#17283

Open
Subhajit578 wants to merge 2 commits intojitsi:masterfrom
Subhajit578:fix/recent-list-leave-url-excalidraw-types
Open

fix(recent-list): prefer conference URL on CONFERENCE_WILL_LEAVE#17283
Subhajit578 wants to merge 2 commits intojitsi:masterfrom
Subhajit578:fix/recent-list-leave-url-excalidraw-types

Conversation

@Subhajit578
Copy link
Copy Markdown
Contributor

When a meeting ends, recent-list updates the stored session duration by matching on a URL. The problem is that web was using features/base/connection.locationURL for this — but that's global connection state. If you leave a meeting and navigate somewhere else quickly, locationURL can already point to the new room before the leave event fires, so the duration ends up stamped on the wrong entry.
Native was already doing this correctly using conference[JITSI_CONFERENCE_URL_KEY], which is scoped to the specific conference being torn down.
Fix -
Align web with native by resolving the URL in this order:

conference?.[JITSI_CONFERENCE_URL_KEY] — tied to the conference actually being left
Fall back to features/base/connection.locationURL if that's not available

Skip the dispatch entirely if neither resolves to a valid href

This closes the race condition and makes the behavior consistent across platforms. Also clears the FIXME in react/features/recent-list/middleware.ts.
Also changed

Cleaned up the forEachConference JSDoc in react/features/base/conference/functions.ts to match what it actually does now.

Testing
npm run tsc:web ran without error
npm run tsc:ci ran without error
npm run lint:ci ran without error
Left a meeting and immediately jumped to a new room — the duration landed on the correct recent entry each time.

…types

- Use JITSI_CONFERENCE_URL_KEY from leaving conference, fallback to connection
- Update forEachConference comment; add ExcalidrawAppProps augmentation for tsc

Made-with: Cursor
@Subhajit578
Copy link
Copy Markdown
Contributor Author

While validating the change, I also hit a separate TypeScript issue when running:
npm run tsc:web
npm run tsc:ci
The build was failing in the whiteboard components because ExcalidrawApp is passed props such as meetingDetails, jwt, and storageBackendUrl, but the published ExcalidrawAppProps type from @jitsi/excalidraw does not declare them.
This appears to be a typing mismatch between the package typings and the runtime props used by the Jitsi fork, rather than an issue introduced by this change.
I fixed it locally with a TypeScript module augmentation so the typecheck passes, but it looks like the proper long-term fix would be updating @jitsi/excalidraw to include those props in its exported typings.

@jitsi-jenkins
Copy link
Copy Markdown

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

* Ensures augmentation merges with the real `@jitsi/excalidraw` typings (see
* TypeScript handbook: module augmentation).
*/
import type {} from '@jitsi/excalidraw';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is this and how is it related to the PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

npm run tsc:web was failing after I pulled the recent changes. I looked into it and it was a typing mismatch.
Deatiled Problem - Whiteboard.tsx and WhiteboardWrapper.tx pass meetingDetails, jwt and strogareBackendUrl to Excalidraw Prop but those props are not declared in ExcalidrawAppProps which causes this. This is just a local typescript module augmentation to make the existing runtime usage match the package typings. So it is not related to the fix - recent-list behaviour fix so I can remove it if needed and work on that separately and raise a pr with the long term fix as I said in the earlier comment.

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @saghul, could you take a look when you get a chance? Happy to drop the whiteboard typing change from this PR and open a separate one PR for it if that's preferred.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like I was getting the issue because I was using a older node version when I updated it it ran perfectly fine. So I have removed [jitsi-excalidraw-augment.d.ts]which was introduced by me to fix the type mismatch error. Could you please review the changes when you get the time. Thank You!

@saghul
Copy link
Copy Markdown
Member

saghul commented Apr 16, 2026

jenkins please test this please.

@Subhajit578
Copy link
Copy Markdown
Contributor Author

I looked through the Allure report, it failed because of media-setup timeouts (waitForReceiveMedia / p1) and I have not touched that part. So I think This can be a flaky test. Can re-run if needed though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants