Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions react/features/base/conference/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ export function forEachConference(
if (v && typeof v === 'object') {
const url: URL = v[JITSI_CONFERENCE_URL_KEY];

// XXX The Web version of Jitsi Meet does not utilize
// JITSI_CONFERENCE_URL_KEY at the time of this writing. An
// alternative is necessary then to recognize JitsiConference
// instances and myUserId is as good as any other property.
// XXX JITSI_CONFERENCE_URL_KEY is set in createConference for the
// normal join path; when it is missing (legacy or unusual paths),
// myUserId is used to recognize JitsiConference instances.
if ((url || typeof v.myUserId === 'function')
&& !predicate(v, url)) {
return false;
Expand Down
36 changes: 12 additions & 24 deletions react/features/recent-list/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,19 @@ function _conferenceWillLeave({ dispatch, getState }: IStore, next: Function, ac
const { doNotStoreRoom } = state['features/base/config'];

if (!doNotStoreRoom && !isEmbedded()) {
let locationURL;

/**
* FIXME:
* It is better to use action.conference[JITSI_CONFERENCE_URL_KEY]
* in order to make sure we get the url the conference is leaving
* from (i.e. The room we are leaving from) because if the order of events
* is different, we cannot be guaranteed that the location URL in base
* connection is the url we are leaving from... Not the one we are going to
* (the latter happens on mobile -- if we use the web implementation);
* however, the conference object on web does not have
* JITSI_CONFERENCE_URL_KEY so we cannot call it and must use the other way.
*/
if (typeof APP === 'undefined') {
const { conference } = action;

// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
locationURL = conference && conference[JITSI_CONFERENCE_URL_KEY];
} else {
locationURL = state['features/base/connection'].locationURL;
const { conference } = action;

// Prefer the URL attached to the JitsiConference at join time
// (see createConference in base/conference/actions.any.ts). That value
// identifies the room we are leaving even if base/connection.locationURL
// has already moved to a different target (e.g. fast leave -> join).
const urlFromConference = conference?.[JITSI_CONFERENCE_URL_KEY];
const { locationURL } = state['features/base/connection'];
const locationURLForDuration = urlFromConference ?? locationURL;

if (locationURLForDuration?.href) {
dispatch(_updateConferenceDuration(locationURLForDuration));
}
dispatch(
_updateConferenceDuration(
locationURL
));
}

return next(action);
Expand Down
17 changes: 17 additions & 0 deletions react/features/whiteboard/jitsi-excalidraw-augment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* 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!


declare module '@jitsi/excalidraw' {
interface ExcalidrawAppProps {
jwt?: string;
meetingDetails?: {
jwt: string;
roomJid: string;
sessionId: string;
};
storageBackendUrl?: string;
}
}