Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Introducing V6 - New realtime 🎉 #635

Merged
merged 48 commits into from
Apr 9, 2024
Merged
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c428b8a
fix: wait to update participant data to emit participant joined
carlossantos74 Mar 26, 2024
c0e26eb
Merge pull request #619 from SuperViz/fix/participant-joined-payload
Raspincel Mar 26, 2024
9215ee8
feat: create flag for disabling presence controls
Raspincel Apr 2, 2024
c0acd9f
fix: update mouse positions after setting transform
Raspincel Apr 2, 2024
b4f9fd2
fix: correct broken tests
Raspincel Apr 2, 2024
0f1d731
fix: make participant being hovered with higher z-index
Raspincel Apr 2, 2024
7f93134
Merge pull request #620 from SuperViz/feat/mouse-follow-wio-flag
Raspincel Apr 2, 2024
53d188f
Merge pull request #621 from SuperViz/fix/tooltip-being-hidden
Raspincel Apr 2, 2024
2c0fcae
fix: ensure focus and send button in editing mode
Apr 3, 2024
3fbc96d
Merge pull request #622 from SuperViz/fix/reply-input
carlossantos74 Apr 4, 2024
802caaf
fix: remove check to local participant on wio list
carlossantos74 Apr 4, 2024
332c94a
fix: only publish joined event to participants that joins after local…
carlossantos74 Apr 4, 2024
e6ce2f6
fix: keep active components updates on old ioc
carlossantos74 Apr 4, 2024
c404c6b
feat: validates if realtime is ready before fetch history
carlossantos74 Apr 4, 2024
eccea92
Merge pull request #624 from SuperViz/fix/participant-events-and-data…
carlossantos74 Apr 4, 2024
05b4f3d
fix: resolve icon
Apr 4, 2024
fcc4ff9
fix: add word break in edit mode
Apr 4, 2024
213e1f8
fix: hidden class
Apr 4, 2024
2dd4322
fix: change resolve icon to md temporary
Apr 4, 2024
bc69da3
refactor: remove unnecessary test
Apr 4, 2024
1c87605
fix: use only the last message from the last hour
carlossantos74 Apr 5, 2024
cb981c0
Merge pull request #625 from SuperViz/fix/participant-events-and-data…
carlossantos74 Apr 5, 2024
646b650
fix: remove hover in confirm button
Apr 5, 2024
a285d72
fix: resolve and undo icon
Apr 5, 2024
9ea2b1c
feat: create who is online store
Raspincel Apr 5, 2024
9864192
fix: revise useStore function usability
Raspincel Apr 5, 2024
81f66d1
feat: separate computation logic and render logic, concentrate inform…
Raspincel Apr 5, 2024
833b2b4
feat: merge newest lab version
Raspincel Apr 5, 2024
e16289b
fix: remove mouses that are already in screen when following participant
Raspincel Apr 5, 2024
755a397
fix: comment ellipsis and close/open in large texts
carlossantos74 Apr 5, 2024
a0df1e1
Merge pull request #626 from SuperViz/fix/reply-input
carlossantos74 Apr 5, 2024
f912d0a
fix: go to participant being followed right away, instead of waiting …
Raspincel Apr 8, 2024
ee83eb1
fix: don't hide participant mouse if they're still in the container area
Raspincel Apr 8, 2024
3e9f02a
feat: update superviz-dropdown options and return
Raspincel Apr 8, 2024
794760b
feat: final wio refactor adjustments
Raspincel Apr 8, 2024
0bd01c4
feat: create tests and jsdocs for methods
Raspincel Apr 8, 2024
8cf2cad
fix: adjust mouse coordinates in test
Raspincel Apr 8, 2024
0411bbb
Merge pull request #627 from SuperViz/feat/presence-controls-flags
carlossantos74 Apr 8, 2024
1052fcd
refactor: remove client sync methods from old io
carlossantos74 Apr 8, 2024
4a4965b
Merge pull request #629 from SuperViz/refactor/remove-client-sync-cha…
carlossantos74 Apr 8, 2024
e5c3aa3
fix: remove flags object, spread properties to options
Raspincel Apr 8, 2024
385b5ee
Merge pull request #630 from SuperViz/feat/presence-controls-flags
carlossantos74 Apr 8, 2024
a603f21
feat: add public signature to transform method
Raspincel Apr 9, 2024
0393f46
Merge pull request #631 from SuperViz/feat/transform-method-public-si…
carlossantos74 Apr 9, 2024
7d1b5ab
fix: any as component type
carlossantos74 Apr 9, 2024
3ce222b
Merge pull request #632 from SuperViz/refactor/remove-client-sync-cha…
carlossantos74 Apr 9, 2024
ba0858a
feat!: introducing v6
carlossantos74 Apr 9, 2024
8477032
Merge pull request #633 from SuperViz/refactor/remove-client-sync-cha…
carlossantos74 Apr 9, 2024
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
3 changes: 1 addition & 2 deletions src/services/realtime/ably/index.test.ts
Original file line number Diff line number Diff line change
@@ -433,7 +433,7 @@ describe('AblyRealtimeService', () => {

expect(AblyRealtimeServiceInstance['isJoinedRoom']).toBe(true);
expect(AblyRealtimeServiceInstance['fetchRoomProperties']).toHaveBeenCalledTimes(2);
expect(AblyRealtimeServiceInstance['updateParticipants']).toHaveBeenCalledTimes(1);
expect(AblyRealtimeServiceInstance['updateParticipants']).toHaveBeenCalledTimes(2);
expect(AblyRealtimeServiceInstance['updateLocalRoomState']).toHaveBeenCalledTimes(1);
expect(AblyRealtimeServiceInstance['publishStateUpdate']).toHaveBeenCalledWith(
RealtimeStateTypes.CONNECTED,
@@ -471,7 +471,6 @@ describe('AblyRealtimeService', () => {

expect(AblyRealtimeServiceInstance['isJoinedRoom']).toBe(true);
expect(AblyRealtimeServiceInstance['fetchRoomProperties']).toHaveBeenCalledTimes(1);
expect(AblyRealtimeServiceInstance['updateParticipants']).not.toBeCalled();
expect(AblyRealtimeServiceInstance['updateLocalRoomState']).not.toBeCalled();
expect(AblyRealtimeServiceInstance['publishStateUpdate']).toHaveBeenCalledWith(
RealtimeStateTypes.CONNECTED,
14 changes: 11 additions & 3 deletions src/services/realtime/ably/index.ts
Original file line number Diff line number Diff line change
@@ -298,6 +298,7 @@ export default class AblyRealtimeService extends RealtimeService implements Ably
*/
public setTranscript(state: TranscriptState): void {
const roomProperties = this.localRoomProperties;

this.updateRoomProperties(Object.assign({}, roomProperties, { transcript: state }));
}

@@ -624,6 +625,8 @@ export default class AblyRealtimeService extends RealtimeService implements Ably
followParticipantId: null,
gather: false,
drawing: null,
transcript: TranscriptState.TRANSCRIPT_STOP,
kickParticipant: null,
};

this.updateParticipants();
@@ -696,14 +699,14 @@ export default class AblyRealtimeService extends RealtimeService implements Ably
* @function fetchRoomProperties
* @returns {AblyRealtimeData | null}
*/
private fetchRoomProperties(): Promise<AblyRealtimeData | null> {
return new Promise((resolve, reject) => {
private async fetchRoomProperties(): Promise<AblyRealtimeData | null> {
const lastMessage: Ably.Types.Message | null = await new Promise((resolve, reject) => {
this.supervizChannel.history((error, resultPage) => {
if (error) {
reject(error);
}

const lastMessage = resultPage.items[0]?.data;
const lastMessage = resultPage.items[0];

if (lastMessage) {
resolve(lastMessage);
@@ -712,6 +715,10 @@ export default class AblyRealtimeService extends RealtimeService implements Ably
}
});
});

if (lastMessage?.timestamp < Date.now() - 1000 * 60 * 60) return null;

return lastMessage?.data || null;
}

/**
@@ -802,6 +809,7 @@ export default class AblyRealtimeService extends RealtimeService implements Ably
): Promise<void> {
this.isJoinedRoom = true;
this.localRoomProperties = await this.fetchRoomProperties();
this.updateParticipants();
this.myParticipant = myPresence;

if (!this.localRoomProperties) {