WPB-26474: extends code to meetings#5281
Conversation
| MakeKey ref -> case ref of | ||
| CodeReferentConv _ -> Code.mkKey ref | ||
| CodeReferentMeeting _ -> | ||
| error "CodeStore.Cassandra.MakeKey: meetings are not supported on cassandra" |
There was a problem hiding this comment.
This would cause 500s, right? If so, we should handle this properly, so the error becomes a 4xx (maybe 404?) something to let the clients know that the server doesn't support this feature.
| mkKeyId :: (MonadIO m) => Id a -> m Key | ||
| mkKeyId ident = do | ||
| sha256 <- liftIO $ fromJust <$> getDigestByName "SHA256" | ||
| pure $ Key . unsafeRange . Ascii.encodeBase64Url . BS.take 15 $ digestBS sha256 (toByteString' cnv) | ||
| pure $ Key . unsafeRange . Ascii.encodeBase64Url . BS.take 15 $ digestBS sha256 (toByteString' ident) |
There was a problem hiding this comment.
Shouldn't we add something here to stop same meetingid and convid collide in the key id?
There was a problem hiding this comment.
I was thinking of prefixing keys like conv:<SHA> but I'm afraid it would break everything, WDYT?
There was a problem hiding this comment.
Yeah, if we change format of pre-existing keys, that'd break.
We can add the prefix for meetings, if you like. Or even just add the prefix before calculating the sha?
Part of me is still wondering if we shouldn't just create a separate store for meeting codes.
There was a problem hiding this comment.
Part of me is still wondering if we shouldn't just create a separate store for meeting codes.
Ignore this, I guess its fine if we keep these in the same table.
Co-authored-by: Akshay Mankar <axeman@mailbox.org>
Co-authored-by: Akshay Mankar <axeman@mailbox.org>
https://wearezeta.atlassian.net/browse/WPB-26474
Checklist
changelog.d