Skip to content

Commit

Permalink
feat: option to wait to return subscribed store data until synced
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed Jan 31, 2025
1 parent ba9dc35 commit 4a6b5a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/datalayer/persistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ const getStoreData = async (storeId, rootHash) => {
logger.trace(
`raw keys and values from RPC for store ${storeId}
${data.keys_values}`,
${JSON.stringify(data.keys_values)}`,
);
return data;
} else {
Expand Down Expand Up @@ -820,6 +820,10 @@ const getSyncStatus = async (storeId) => {

const data = response.body;

logger.trace(
`the /get_sync_status RPC response for store ${storeId} is ${JSON.parse(data)}`,
);

// We just care that we got some response, not what the response is
if (Object.keys(data).includes('success')) {
return data;
Expand Down
2 changes: 1 addition & 1 deletion src/datalayer/syncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const getSubscribedStoreData = async (
logger.trace(
`the data for subscribed store ${storeId} after conversion to js Object is:
${decodedData}`,
${JSON.stringify(decodedData)}`,
);

if (!decodedData) {
Expand Down

0 comments on commit 4a6b5a0

Please sign in to comment.