Просмотр исходного кода

Merge pull request #13522 from overleaf/msm-real-time-remove-token-change

[real-time] Delete 'project:tokens:changed' references

GitOrigin-RevId: b6e5c859ea79ffb41204c53e98726e19f91528d1
Miguel Serrano 3 лет назад
Родитель
Сommit
780e5fdca5

+ 0 - 14
services/real-time/app/js/WebsocketLoadBalancer.js

@@ -190,20 +190,6 @@ module.exports = WebsocketLoadBalancer = {
                   },
                   'hiding restricted message from client'
                 )
-              } else if (
-                message.message === 'project:tokens:changed' &&
-                client.ol_context.owner_id !== client.ol_context.user_id
-              ) {
-                // hide owner only message
-                logger.debug(
-                  {
-                    message,
-                    clientId: client.id,
-                    userId: client.ol_context.user_id,
-                    projectId: client.ol_context.project_id,
-                  },
-                  'hiding owner only message from client'
-                )
               } else {
                 client.emit(message.message, ...message.payload)
               }

+ 0 - 27
services/real-time/test/acceptance/js/ReceiveEditorEventTests.js

@@ -234,7 +234,6 @@ describe('receiveEditorEvent', function () {
             'userRemovedFromProject',
             'project:publicAccessLevel:changed',
             'project:access:revoked',
-            'project:tokens:changed',
           ]
 
           for (const eventName of eventNames) {
@@ -274,32 +273,6 @@ describe('receiveEditorEvent', function () {
     }
   })
 
-  describe('event: project:tokens:changed', function () {
-    beforeEach(function (done) {
-      rclient.publish(
-        'editor-events',
-        JSON.stringify({
-          room_id: this.project_id,
-          message: 'project:tokens:changed',
-          payload: [{ tokens: 'TOKENS' }],
-        })
-      )
-      setTimeout(done, 200)
-    })
-
-    it('should send the event to the owner', function () {
-      expect(this.owner_updates).to.deep.equal([
-        { 'project:tokens:changed': { tokens: 'TOKENS' } },
-      ])
-    })
-
-    it('should not send the event to the other clients', function () {
-      expect(this.user_a_updates).to.deep.equal([])
-      expect(this.user_b_updates).to.deep.equal([])
-      expect(this.user_c_updates).to.deep.equal([])
-    })
-  })
-
   describe('event: project:publicAccessLevel:changed, set to private', function () {
     beforeEach(function (done) {
       /**