Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
jio
Commits
0cb41c37
Commit
0cb41c37
authored
Apr 11, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replicatestorage: signature storage database prop is storage hash
parent
754e5df9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
9 deletions
+45
-9
src/jio.storage/replicatestorage.js
src/jio.storage/replicatestorage.js
+16
-8
test/jio.storage/replicatestorage.tests.js
test/jio.storage/replicatestorage.tests.js
+29
-1
No files found.
src/jio.storage/replicatestorage.js
View file @
0cb41c37
...
@@ -55,11 +55,16 @@
...
@@ -55,11 +55,16 @@
stringify
(
spec
.
remote_sub_storage
)
+
stringify
(
spec
.
remote_sub_storage
)
+
stringify
(
this
.
_query_options
)
stringify
(
this
.
_query_options
)
);
);
if
(
spec
.
signature_storage
!==
undefined
)
{
spec
.
signature_storage
.
database
=
this
.
_signature_hash
;
this
.
_signature_sub_storage
=
jIO
.
createJIO
(
spec
.
signature_storage
);
}
else
{
this
.
_signature_sub_storage
=
jIO
.
createJIO
({
this
.
_signature_sub_storage
=
jIO
.
createJIO
({
type
:
"
document
"
,
type
:
"
document
"
,
document_id
:
this
.
_signature_hash
,
document_id
:
this
.
_signature_hash
,
sub_storage
:
spec
.
signature_storage
||
spec
.
local_sub_storage
sub_storage
:
spec
.
local_sub_storage
});
});
}
this
.
_use_remote_post
=
spec
.
use_remote_post
||
false
;
this
.
_use_remote_post
=
spec
.
use_remote_post
||
false
;
// Number of request we allow browser execution for attachments
// Number of request we allow browser execution for attachments
...
@@ -983,9 +988,12 @@
...
@@ -983,9 +988,12 @@
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
// Ensure that the document storage is usable
// Ensure that the document storage is usable
if
(
context
.
_signature_sub_storage
.
__type
===
"
document
"
)
{
return
context
.
_signature_sub_storage
.
__storage
.
_sub_storage
.
get
(
return
context
.
_signature_sub_storage
.
__storage
.
_sub_storage
.
get
(
context
.
_signature_hash
context
.
_signature_hash
);
);
}
return
;
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
...
...
test/jio.storage/replicatestorage.tests.js
View file @
0cb41c37
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
equal
(
jio
.
__storage
.
_check_remote_attachment_deletion
,
true
);
equal
(
jio
.
__storage
.
_check_remote_attachment_deletion
,
true
);
equal
(
jio
.
__storage
.
_check_remote_attachment_modification
,
true
);
equal
(
jio
.
__storage
.
_check_remote_attachment_modification
,
true
);
equal
(
jio
.
__storage
.
_signature_sub_storage
.
__
storage
.
_sub_storage
.
__
type
,
equal
(
jio
.
__storage
.
_signature_sub_storage
.
__type
,
"
signaturestorage2713
"
);
"
signaturestorage2713
"
);
equal
(
jio
.
__storage
.
_signature_hash
,
equal
(
jio
.
__storage
.
_signature_hash
,
"
_replicate_11881e431308c0ec8c0e6430be98db380e1b92f8
"
);
"
_replicate_11881e431308c0ec8c0e6430be98db380e1b92f8
"
);
...
@@ -4649,6 +4649,34 @@
...
@@ -4649,6 +4649,34 @@
});
});
});
});
test
(
"
signature storage database named as hash
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
type
:
"
replicate
"
,
signature_storage
:
{
type
:
"
indexeddb
"
},
local_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
},
remote_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
}
});
equal
(
"
jio:_replicate_b9296354cdf1dbe0046de11f57a5a24f8f6a78a8
"
,
jio
.
__storage
.
_signature_sub_storage
.
__storage
.
_database_name
,
"
database equal hash
"
);
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// attachment replication
// attachment replication
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment