-
Notifications
You must be signed in to change notification settings - Fork 87
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
Update orbitdb #2600
base: develop
Are you sure you want to change the base?
Update orbitdb #2600
Conversation
6b0cea5
to
0695992
Compare
} | ||
|
||
return this.ipfsInstance | ||
} | ||
|
||
private async initializeStores(init?: StoreInit): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more complicated than it should be because we need to ensure that valueEncoding is set to buffer no matter what. I hit so many issues due to level not properly encoding to buffer...
@@ -0,0 +1,76 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wrapper allows us to use the correct valueEncoding on all of our OrbitDB DBs.
@@ -0,0 +1,60 @@ | |||
import { AccessControllerType, IdentitiesType, LogEntry, Events, LogType } from '@orbitdb/core' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wrapper allows us to ensure the correct level value encoding.
@@ -0,0 +1,60 @@ | |||
import { AccessControllerType, KeyValue, IdentitiesType, LogType, LogEntry } from '@orbitdb/core' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wrapper allows us to ensure the correct level value encoding.
throw new Error('IPFS instance does not exist') | ||
} | ||
|
||
await this.blockstore?.db.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little weird but there are issues that can arise from not closing the underlying level DB, apparently.
@@ -102,7 +102,8 @@ export class CertificatesRequestsStore extends EventStoreBase<string> { | |||
const pubKey = keyFromCertificate(parsedCsr) | |||
|
|||
if (filteredCsrsMap.has(pubKey)) { | |||
filteredCsrsMap.delete(pubKey) | |||
this.logger.warn(`Skipping csr due to existing pubkey`, pubKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event store now returns records in descending order rather than ascending order.
|
||
const storage = await ComposedStorage( | ||
await LRUStorage({ size: 1000 }), | ||
await LevelStorage({ path, valueEncoding: 'buffer' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Level value encoding strikes again.
@@ -16,9 +16,11 @@ export const processInvitationCode = (mainWindow: BrowserWindow, code: string | | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had nothing to do with the upgrade but I got tired of the errors so I cleaned this up.
backendProcess = fork(backendBundlePath, forkArgvs, { | ||
env: { | ||
NODE_OPTIONS: '--experimental-global-customevent', | ||
DEBUG: 'backend*,quiet*,state-manager*,desktop*,utils*,identity*,common*,libp2p:connection-manager:auto-dial', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug flag doesn't seem to be inherited from desktop anymore for some reason.
@@ -1,3 +1,5 @@ | |||
import { jest } from '@jest/globals' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up the test organization and introduced some improvements.
import { createLogger } from './logger' | ||
|
||
const logger = createLogger('utils') | ||
|
||
export const BACKWARD_COMPATIBILITY_BASE_VERSION = '2.0.1' // Pre-latest production version | ||
export const BACKWARD_COMPATIBILITY_BASE_VERSION = '2.3.1' // Pre-latest production version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't actually end up needing this but we'll wanna update this when we know if this will be part of 3.0.0 or 4.0.0.
@@ -0,0 +1,9 @@ | |||
root = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added helia as a package which is NOT ideal but it was the fastest way to get it integrated, from my perspective. We should ultimately update it to be a submodule like lfa but I don't have it in me to do it right now.
@@ -176,7 +176,7 @@ - (void)applicationDidEnterBackground:(UIApplication *)application | |||
{ | |||
[self stopTor]; | |||
|
|||
NSString * message = [NSString stringWithFormat:@""]; | |||
NSString * message = [NSString stringWithFormat:@"app:close"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just to get rid of an error that didn't break anything, it was just annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an older client that has updated to this commit is loaded, the invitationLink will be invalid due to the PeerID being invalid.
Pull Request Checklist
(Optional) Mobile checklist
Please ensure you completed the following checks if you did any changes to the mobile package: