Sfoglia il codice sorgente

feat(JitsiConnection) force reload page on shard changes.

master
Jaya Allamsetty 6 mesi fa
parent
commit
864d0f0199

+ 0
- 12
JitsiConference.js Vedi File

2906
         ? this.isP2PConnectionInterrupted : this.isJvbConnectionInterrupted;
2906
         ? this.isP2PConnectionInterrupted : this.isJvbConnectionInterrupted;
2907
 };
2907
 };
2908
 
2908
 
2909
-/**
2910
- * Handles {@link XMPPEvents.CONNECTION_RESTARTED} event. This happens when the bridge goes down
2911
- * and Jicofo moves conferences away to a different bridge.
2912
- * @param {JingleSessionPC} session
2913
- * @private
2914
- */
2915
-JitsiConference.prototype._onConferenceRestarted = function(session) {
2916
-    if (!session.isP2P && this.options.config.enableForcedReload) {
2917
-        this.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CONFERENCE_RESTARTED);
2918
-    }
2919
-};
2920
-
2921
 /**
2909
 /**
2922
  * Handles {@link XMPPEvents.CONNECTION_INTERRUPTED}
2910
  * Handles {@link XMPPEvents.CONNECTION_INTERRUPTED}
2923
  * @param {JingleSessionPC} session
2911
  * @param {JingleSessionPC} session

+ 0
- 5
JitsiConferenceEventManager.js Vedi File

193
         XMPPEvents.BRIDGE_DOWN,
193
         XMPPEvents.BRIDGE_DOWN,
194
         () => Statistics.sendAnalytics(createBridgeDownEvent()));
194
         () => Statistics.sendAnalytics(createBridgeDownEvent()));
195
 
195
 
196
-    chatRoom.addListener(XMPPEvents.CONNECTION_RESTARTED,
197
-        jingleSession => {
198
-            conference._onConferenceRestarted(jingleSession);
199
-        });
200
-
201
     this.chatRoomForwarder.forward(XMPPEvents.RESERVATION_ERROR,
196
     this.chatRoomForwarder.forward(XMPPEvents.RESERVATION_ERROR,
202
         JitsiConferenceEvents.CONFERENCE_FAILED,
197
         JitsiConferenceEvents.CONFERENCE_FAILED,
203
         JitsiConferenceErrors.RESERVATION_ERROR);
198
         JitsiConferenceErrors.RESERVATION_ERROR);

+ 2
- 0
JitsiConnectionErrors.spec.ts Vedi File

10
         OTHER_ERROR,
10
         OTHER_ERROR,
11
         PASSWORD_REQUIRED,
11
         PASSWORD_REQUIRED,
12
         SERVER_ERROR,
12
         SERVER_ERROR,
13
+        SHARD_CHANGED_ERROR,
13
         JitsiConnectionErrors,
14
         JitsiConnectionErrors,
14
         ...others
15
         ...others
15
     } = exported;
16
     } = exported;
30
         expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
31
         expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
31
         expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
32
         expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
32
         expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
33
         expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
34
+        expect( JitsiConnectionErrors.SHARD_CHANGED_ERROR ).toBe( 'connection.shardChangedError' );
33
     } );
35
     } );
34
 
36
 
35
     it( "unknown members", () => {
37
     it( "unknown members", () => {

+ 7
- 1
JitsiConnectionErrors.ts Vedi File

41
      * Indicates that the connection was dropped, because of too many 5xx HTTP
41
      * Indicates that the connection was dropped, because of too many 5xx HTTP
42
      * errors on BOSH requests.
42
      * errors on BOSH requests.
43
      */
43
      */
44
-    SERVER_ERROR = 'connection.serverError'
44
+    SERVER_ERROR = 'connection.serverError',
45
+
46
+    /**
47
+     * Indicates that the connection was dropped, because of conference being moved to a new shard.
48
+     */
49
+    SHARD_CHANGED_ERROR = 'connection.shardChangedError'
45
 }
50
 }
46
 
51
 
47
 // exported for backward compatibility
52
 // exported for backward compatibility
51
 export const OTHER_ERROR = JitsiConnectionErrors.OTHER_ERROR;
56
 export const OTHER_ERROR = JitsiConnectionErrors.OTHER_ERROR;
52
 export const PASSWORD_REQUIRED = JitsiConnectionErrors.PASSWORD_REQUIRED;
57
 export const PASSWORD_REQUIRED = JitsiConnectionErrors.PASSWORD_REQUIRED;
53
 export const SERVER_ERROR = JitsiConnectionErrors.SERVER_ERROR;
58
 export const SERVER_ERROR = JitsiConnectionErrors.SERVER_ERROR;
59
+export const SHARD_CHANGED_ERROR = JitsiConnectionErrors.SHARD_CHANGED_ERROR;

+ 13
- 6
modules/xmpp/xmpp.js Vedi File

196
             };
196
             };
197
             /* eslint-enable camelcase */
197
             /* eslint-enable camelcase */
198
 
198
 
199
-            this.eventEmitter.emit(
200
-                JitsiConnectionEvents.CONNECTION_FAILED,
201
-                JitsiConnectionErrors.OTHER_ERROR,
202
-                undefined,
203
-                undefined,
204
-                details);
199
+            if (this.options.testing?.enableGracefulReconnect) {
200
+                this.eventEmitter.emit(
201
+                    JitsiConnectionEvents.CONNECTION_FAILED,
202
+                    JitsiConnectionErrors.SHARD_CHANGED_ERROR
203
+                );
204
+            } else {
205
+                this.eventEmitter.emit(
206
+                    JitsiConnectionEvents.CONNECTION_FAILED,
207
+                    JitsiConnectionErrors.OTHER_ERROR,
208
+                    undefined,
209
+                    undefined,
210
+                    details);
211
+            }
205
         });
212
         });
206
 
213
 
207
         this._initStrophePlugins();
214
         this._initStrophePlugins();

+ 0
- 1
service/xmpp/XMPPEvents.spec.ts Vedi File

27
         expect( XMPPEvents.CONNECTION_INTERRUPTED ).toBe( 'xmpp.connection.interrupted' );
27
         expect( XMPPEvents.CONNECTION_INTERRUPTED ).toBe( 'xmpp.connection.interrupted' );
28
         expect( XMPPEvents.CONNECTION_RESTORED ).toBe( 'xmpp.connection.restored' );
28
         expect( XMPPEvents.CONNECTION_RESTORED ).toBe( 'xmpp.connection.restored' );
29
         expect( XMPPEvents.CONNECTION_ICE_FAILED ).toBe( 'xmpp.connection.ice.failed' );
29
         expect( XMPPEvents.CONNECTION_ICE_FAILED ).toBe( 'xmpp.connection.ice.failed' );
30
-        expect( XMPPEvents.CONNECTION_RESTARTED ).toBe( 'xmpp.connection.restart' );
31
         expect( XMPPEvents.CONNECTION_STATUS_CHANGED ).toBe( 'xmpp.connection.status.changed' );
30
         expect( XMPPEvents.CONNECTION_STATUS_CHANGED ).toBe( 'xmpp.connection.status.changed' );
32
         expect( XMPPEvents.DISPLAY_NAME_CHANGED ).toBe( 'xmpp.display_name_changed' );
31
         expect( XMPPEvents.DISPLAY_NAME_CHANGED ).toBe( 'xmpp.display_name_changed' );
33
         expect( XMPPEvents.EMUC_ROOM_ADDED ).toBe( 'xmpp.emuc_room_added' );
32
         expect( XMPPEvents.EMUC_ROOM_ADDED ).toBe( 'xmpp.emuc_room_added' );

+ 0
- 4
service/xmpp/XMPPEvents.ts Vedi File

100
     // interrupted. This should go to the RTC module.
100
     // interrupted. This should go to the RTC module.
101
     CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
101
     CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
102
 
102
 
103
-    // Designates an event indicating that the call has been migrated to a different
104
-    // bridge and that the client needs to be restarted for a successful transition.
105
-    CONNECTION_RESTARTED = 'xmpp.connection.restart',
106
-
107
     // Designates an event indicating that the media (ICE) connection was
103
     // Designates an event indicating that the media (ICE) connection was
108
     // restored. This should go to the RTC module.
104
     // restored. This should go to the RTC module.
109
     CONNECTION_RESTORED = 'xmpp.connection.restored',
105
     CONNECTION_RESTORED = 'xmpp.connection.restored',

+ 0
- 1
types/hand-crafted/service/xmpp/XMPPEvents.d.ts Vedi File

14
   CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
14
   CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
15
   CONNECTION_RESTORED = 'xmpp.connection.restored',
15
   CONNECTION_RESTORED = 'xmpp.connection.restored',
16
   CONNECTION_ICE_FAILED = 'xmpp.connection.ice.failed',
16
   CONNECTION_ICE_FAILED = 'xmpp.connection.ice.failed',
17
-  CONNECTION_RESTARTED = 'xmpp.connection.restart',
18
   CONNECTION_STATUS_CHANGED = 'xmpp.connection.status.changed',
17
   CONNECTION_STATUS_CHANGED = 'xmpp.connection.status.changed',
19
   DISPLAY_NAME_CHANGED = 'xmpp.display_name_changed',
18
   DISPLAY_NAME_CHANGED = 'xmpp.display_name_changed',
20
   EMUC_ROOM_ADDED = 'xmpp.emuc_room_added',
19
   EMUC_ROOM_ADDED = 'xmpp.emuc_room_added',

Loading…
Annulla
Salva