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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
jio
Commits
027845e3
Commit
027845e3
authored
Apr 11, 2017
by
Vincent Bechu
Committed by
Romain Courteaud
May 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplicateStorage: signature storage database prop is storage hash
parent
68c2249d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
13 deletions
+52
-13
src/jio.storage/replicatestorage.js
src/jio.storage/replicatestorage.js
+22
-12
test/jio.storage/replicatestorage.tests.js
test/jio.storage/replicatestorage.tests.js
+30
-1
No files found.
src/jio.storage/replicatestorage.js
View file @
027845e3
...
...
@@ -55,14 +55,22 @@
stringify
(
spec
.
remote_sub_storage
)
+
stringify
(
this
.
_query_options
)
);
if
(
spec
.
signature_sub_storage
!==
undefined
)
{
// spec.signature_storage.database = this._signature_hash;
this
.
_signature_sub_storage
=
jIO
.
createJIO
(
spec
.
signature_sub_storage
);
this
.
_custom_signature_sub_storage
=
true
;
}
else
{
this
.
_signature_sub_storage
=
jIO
.
createJIO
({
type
:
"
query
"
,
sub_storage
:
{
type
:
"
document
"
,
document_id
:
this
.
_signature_hash
,
sub_storage
:
spec
.
signature_storage
||
spec
.
local_sub_storage
sub_storage
:
spec
.
local_sub_storage
}
});
this
.
_custom_signature_sub_storage
=
false
;
}
this
.
_use_remote_post
=
spec
.
use_remote_post
||
false
;
// Number of request we allow browser execution for attachments
...
...
@@ -943,10 +951,12 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Ensure that the document storage is usable
if
(
context
.
_custom_signature_sub_storage
===
false
)
{
return
context
.
_signature_sub_storage
.
__storage
.
_sub_storage
.
__storage
.
_sub_storage
.
get
(
context
.
_signature_hash
);
}
})
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
jIO
.
util
.
jIOError
)
&&
...
...
test/jio.storage/replicatestorage.tests.js
View file @
027845e3
...
...
@@ -237,6 +237,35 @@
);
});
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
"
);
});
/////////////////////////////////////////////////////////////////
// replicateStorage.get
/////////////////////////////////////////////////////////////////
...
...
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