Skip to content

EXCEPTION!!!: UnknownHashId (HashId 526) #1919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aryairani opened this issue May 7, 2021 · 1 comment
Closed

EXCEPTION!!!: UnknownHashId (HashId 526) #1919

aryairani opened this issue May 7, 2021 · 1 comment
Assignees

Comments

@aryairani
Copy link
Contributor

While debugging #1918, I started getting this different error instead. It's crashing on line 382, which seems to suggest that there are some bad ids in the LocalIds:

syncWatch :: WK.WatchKind -> Sqlite.Reference.IdH -> m Bool
syncWatch wk r = do
r' <- traverse syncHashLiteral r
doneKinds <- runDest (Q.loadWatchKindsByReference r')
if (wk `elem` doneKinds) then do
runSrc (Q.loadWatch wk r) >>= traverse \blob -> do
(L.LocalIds tIds hIds, termBytes) <-
case runGetS S.decomposeWatchResult blob of
Right x -> pure x
Left s -> throwError $ DecodeError ErrWatchResult blob s
tIds' <- traverse syncTextLiteral tIds
hIds' <- traverse syncHashLiteral hIds
when debug $ traceM $ "LocalIds for Source watch result " ++ show r ++ ": " ++ show (tIds, hIds)
when debug $ traceM $ "LocalIds for Dest watch result " ++ show r' ++ ": " ++ show (tIds', hIds')
let blob' = runPutS (S.recomposeWatchResult (L.LocalIds tIds' hIds', termBytes))
runDest (Q.saveWatch wk r' blob')
pure True
else pure False

@aryairani aryairani self-assigned this May 8, 2021
@aryairani
Copy link
Contributor Author

aryairani commented May 8, 2021

Hypothesis: Some spots deserializing watch results (e.g. line 378) are not expecting/handling the format tag (which was a late addition to serialized watch results), so there's an off-by-one byte issue and it's a miracle that anything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant