Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eed9d78b5a |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yjs",
|
||||
"version": "13.0.0-7",
|
||||
"version": "13.0.0-6",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yjs",
|
||||
"version": "13.0.0-7",
|
||||
"version": "13.0.0-6",
|
||||
"description": "A framework for real-time p2p shared editing on any data",
|
||||
"main": "./y.node.js",
|
||||
"browser": "./y.js",
|
||||
|
||||
@@ -269,20 +269,17 @@ export default function extendConnector (Y/* :any */) {
|
||||
})
|
||||
return Promise.reject(new Error('Incompatible protocol version'))
|
||||
}
|
||||
if ((message.type === 'sync step 1' || message.type === 'sync step 2') && this.connections[sender] != null && this.connections[sender].auth == null) {
|
||||
if (message.type === 'sync step 1' && this.connections[sender] != null && this.connections[sender].auth == null) {
|
||||
// authenticate using auth in message
|
||||
var auth = this.checkAuth(message.auth, this.y)
|
||||
this.connections[sender].auth = auth
|
||||
auth.then(auth => {
|
||||
// in case operations were received before sender was received
|
||||
// we apply the messages after authentication
|
||||
this.connections[sender].syncStep2.promise.then(() => {
|
||||
// we do it after sync step 1
|
||||
this.connections[sender].waitingMessages.forEach(msg => {
|
||||
this.receiveMessage(sender, msg)
|
||||
})
|
||||
this.connections[sender].waitingMessages = null
|
||||
this.connections[sender].waitingMessages.forEach(msg => {
|
||||
this.receiveMessage(sender, msg)
|
||||
})
|
||||
this.connections[sender].waitingMessages = null
|
||||
for (var f of this.userEventListeners) {
|
||||
f({
|
||||
action: 'userAuthenticated',
|
||||
@@ -392,7 +389,7 @@ export default function extendConnector (Y/* :any */) {
|
||||
})
|
||||
} else if (this.connections[sender] != null) {
|
||||
// wait for authentication
|
||||
let senderConn = this.connections[sender]
|
||||
let senderConn = this.connection[sender]
|
||||
senderConn.waitingMessages = senderConn.waitingMessages || []
|
||||
senderConn.waitingMessages.push(message)
|
||||
} else {
|
||||
|
||||
15
y.node.js
15
y.node.js
@@ -1,7 +1,7 @@
|
||||
|
||||
/**
|
||||
* yjs - A framework for real-time p2p shared editing on any data
|
||||
* @version v13.0.0-7
|
||||
* @version v13.0.0-6
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
@@ -830,20 +830,17 @@ function extendConnector (Y/* :any */) {
|
||||
});
|
||||
return Promise.reject(new Error('Incompatible protocol version'))
|
||||
}
|
||||
if ((message.type === 'sync step 1' || message.type === 'sync step 2') && this.connections[sender] != null && this.connections[sender].auth == null) {
|
||||
if (message.type === 'sync step 1' && this.connections[sender] != null && this.connections[sender].auth == null) {
|
||||
// authenticate using auth in message
|
||||
var auth = this.checkAuth(message.auth, this.y);
|
||||
this.connections[sender].auth = auth;
|
||||
auth.then(auth => {
|
||||
// in case operations were received before sender was received
|
||||
// we apply the messages after authentication
|
||||
this.connections[sender].syncStep2.promise.then(() => {
|
||||
// we do it after sync step 1
|
||||
this.connections[sender].waitingMessages.forEach(msg => {
|
||||
this.receiveMessage(sender, msg);
|
||||
});
|
||||
this.connections[sender].waitingMessages = null;
|
||||
this.connections[sender].waitingMessages.forEach(msg => {
|
||||
this.receiveMessage(sender, msg);
|
||||
});
|
||||
this.connections[sender].waitingMessages = null;
|
||||
for (var f of this.userEventListeners) {
|
||||
f({
|
||||
action: 'userAuthenticated',
|
||||
@@ -953,7 +950,7 @@ function extendConnector (Y/* :any */) {
|
||||
})
|
||||
} else if (this.connections[sender] != null) {
|
||||
// wait for authentication
|
||||
let senderConn = this.connections[sender];
|
||||
let senderConn = this.connection[sender];
|
||||
senderConn.waitingMessages = senderConn.waitingMessages || [];
|
||||
senderConn.waitingMessages.push(message);
|
||||
} else {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user