Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
yjs
Compare revisions
ba068ea6a62d6a124047fd3dd0075adecd5d149a to 44aa194d19217cbc1d8e0828cf8fdf39fc4dcdd3
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
sweng-group-15/yjs
Select target project
No results found
44aa194d19217cbc1d8e0828cf8fdf39fc4dcdd3
Select Git revision
Swap
Target
sweng-group-15/yjs
Select target project
sweng-group-15/yjs
1 result
ba068ea6a62d6a124047fd3dd0075adecd5d149a
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
(ml5717) Added y-js resync for partial mesh topology (ensure syncs are propagated)
· c2a07807
Moritz Langenstein
authored
5 years ago
c2a07807
Fix minor issue with error checking and message
· 2942c3b3
Alexander Harkness
authored
5 years ago
2942c3b3
(ml5717) Union struct first merge sync fix
· 44aa194d
Moritz Langenstein
authored
5 years ago
44aa194d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Connector.js
+18
-2
18 additions, 2 deletions
src/Connector.js
src/Struct.js
+7
-2
7 additions, 2 deletions
src/Struct.js
src/y.js
+1
-1
1 addition, 1 deletion
src/y.js
with
26 additions
and
5 deletions
src/Connector.js
View file @
44aa194d
...
...
@@ -351,13 +351,29 @@ module.exports = function (Y/* :any */) {
}
})
*/
defer
.
resolve
()
defer
.
resolve
(
m
.
os
&&
m
.
os
.
length
>
0
)
})
}
else
if
(
message
.
type
===
'
sync done
'
)
{
var
self
=
this
this
.
connections
[
sender
].
syncStep2
.
then
(
function
()
{
this
.
connections
[
sender
].
syncStep2
.
then
(
function
(
resync
)
{
if
(
resync
)
{
const
answer
=
{
type
:
'
sync check
'
,
}
for
(
const
uid
in
self
.
connections
)
{
if
(
uid
!==
sender
)
{
self
.
send
(
uid
,
answer
)
}
}
}
self
.
_setSyncedWith
(
sender
)
})
}
else
if
(
message
.
type
===
'
sync check
'
)
{
const
conn
=
this
.
connections
[
sender
]
if
(
conn
!=
null
&&
conn
.
isSynced
)
{
conn
.
isSynced
=
false
}
this
.
findNextSyncTarget
()
}
else
if
(
message
.
type
===
'
update
'
&&
canWrite
(
auth
))
{
if
(
this
.
forwardToSyncingClients
)
{
for
(
var
client
of
this
.
syncingClients
)
{
...
...
This diff is collapsed.
Click to expand it.
src/Struct.js
View file @
44aa194d
...
...
@@ -165,7 +165,7 @@ module.exports = function (Y/* :any */) {
o
=
(
o
.
right
==
null
)
?
null
:
yield
*
this
.
getOperation
(
o
.
right
)
}
else
{
// left == null
parent
=
yield
*
this
.
getOperation
(
op
.
parent
)
let
startId
=
op
.
parentSub
?
parent
.
map
[
op
.
parentSub
]
:
parent
.
start
let
startId
=
op
.
parentSub
?
parent
.
map
[
op
.
parentSub
]
:
(
parent
.
struct
==
"
Union
"
?
parent
.
union
:
parent
.
start
)
start
=
startId
==
null
?
null
:
yield
*
this
.
getOperation
(
startId
)
o
=
start
}
...
...
@@ -223,7 +223,7 @@ module.exports = function (Y/* :any */) {
yield
*
this
.
setOperation
(
left
)
}
else
{
// set op.right from parent, if necessary
op
.
right
=
op
.
parentSub
?
parent
.
map
[
op
.
parentSub
]
||
null
:
parent
.
start
op
.
right
=
op
.
parentSub
?
parent
.
map
[
op
.
parentSub
]
||
null
:
(
parent
.
struct
==
"
Union
"
?
parent
.
union
:
parent
.
start
)
}
// reconnect right
if
(
op
.
right
!=
null
)
{
...
...
@@ -256,6 +256,11 @@ module.exports = function (Y/* :any */) {
if
(
op
.
left
!=
null
)
{
yield
*
this
.
deleteOperation
(
op
.
id
,
1
,
true
)
}
}
else
if
(
parent
.
struct
==
"
Union
"
)
{
if
(
left
==
null
)
{
parent
.
union
=
op
.
id
yield
*
this
.
setOperation
(
parent
)
}
}
else
{
if
(
right
==
null
||
left
==
null
)
{
if
(
right
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
src/y.js
View file @
44aa194d
...
...
@@ -124,7 +124,7 @@ function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
else
if
(
opts
.
connector
==
null
)
reject
(
'
You must specify a connector! (missing connector property)
'
)
else
if
(
opts
.
connector
.
name
==
null
)
reject
(
'
You must specify connector name! (missing connector.name property)
'
)
else
if
(
opts
.
db
==
null
)
reject
(
'
You must specify a database! (missing db property)
'
)
else
if
(
opts
.
connector
.
name
==
null
)
reject
(
'
You must specify db name! (missing db.name property)
'
)
else
if
(
opts
.
db
.
name
==
null
)
reject
(
'
You must specify db name! (missing db.name property)
'
)
else
{
opts
=
Y
.
utils
.
copyObject
(
opts
)
opts
.
connector
=
Y
.
utils
.
copyObject
(
opts
.
connector
)
...
...
This diff is collapsed.
Click to expand it.