[PB-6503] Add new sharings#1996
Conversation
Deploying drive-web with
|
| Latest commit: |
5dc75a0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://801ac28c.drive-web.pages.dev |
| Branch Preview URL: | https://add-new-sharings.drive-web.pages.dev |
CandelR
left a comment
There was a problem hiding this comment.
waiting server changes to test it
|
@CandelR Server is ready, we can test it |
| token: string; | ||
| } | ||
|
|
||
| const NEW_SHARING_VERSION = 'inxt-v3'; |
There was a problem hiding this comment.
nit: It would be better if both the server and the website had a single source of truth, because if it changes again one day and this logic isn’t taken into account, it could break
There was a problem hiding this comment.
Yes, but I'm not sure where to put it. SDK types?
There was a problem hiding this comment.
It should be the backend, the SDK is only a reflect of it @TamaraFinogina
| if (encriptedMnemonic) { | ||
| const ownerMnemonic = await decryptMnemonic(encriptedMnemonic); | ||
| if (ownerMnemonic) mnemonic = ownerMnemonic; | ||
| if (ownerMnemonic) localStorageService.set(LocalStorageItem.UserMnemonic, ownerMnemonic); |
There was a problem hiding this comment.
rewrite own mnemonic with another users one not seems good idea. This can lead in decript or encription errors if in some point we use this one.
Maybe I’m getting this wrong, could you confirm it?
There was a problem hiding this comment.
Old logic was:
Do sharing (which requires a mnemonic, so without a mnemonic it does something strange), then check if the encrypted mnemonic is given and the user is invited; if so, use it to decrypt the code.
Now:
I moved code decryption inside the function, so I need to have the mnemonic in advance. The only place that calls getPublicShareLink with an encrypted mnemonic is onCopyLink in case isAdvancedShareItem exists. I think it's sharing with an invitation. So, it should be the same. But I'm a bit confused about how it was working before: if the mnemonic was undefined prior to setting it - it should have failed share creation; if the mnemonic of the invited user was already set at that point - why double setting? I'm lost.
There was a problem hiding this comment.
@CandelR Fixed, should be exactly as before
|
| expect(spyDecrypt).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| test('When encrypted code changes, decrypt code', async () => { |
There was a problem hiding this comment.
When does this happen? I am not sure
There was a problem hiding this comment.
@sg-gs, it's when we share the same file again. If the file was already shared, the server will not change sharings, and to access the file via the link, we need the same code as in the server records, so we decrypt it.



Description
This PR switches to new public sharing version
Related Pull Requests
Server change
Checklist
Testing Process
Additional Notes