mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
Merge pull request #13522 from overleaf/msm-real-time-remove-token-change
[real-time] Delete 'project:tokens:changed' references GitOrigin-RevId: b6e5c859ea79ffb41204c53e98726e19f91528d1
This commit is contained in:
parent
49eafa2712
commit
780e5fdca5
2 changed files with 0 additions and 41 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue