Skip to content
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

release: 3.0.0 #2689

Merged
merged 48 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
432a041
Update orbitdb (#2600)
leblowl Dec 20, 2024
90fa2df
Update CHANGELOG.md
islathehut Dec 20, 2024
af4215d
Publish
islathehut Dec 20, 2024
ef189db
Update packages CHANGELOG.md
islathehut Dec 20, 2024
354c903
Split file generation logic apart because fs import breaks mobile
islathehut Dec 20, 2024
0fd5de5
Publish
islathehut Dec 20, 2024
78981c1
Update packages CHANGELOG.md
islathehut Dec 20, 2024
2d81f3f
chore: Upgrade orbitdb to 2.4.3 (#2684)
islathehut Dec 31, 2024
7890481
Publish
islathehut Dec 31, 2024
5986fc3
Update packages CHANGELOG.md
islathehut Dec 31, 2024
1c32ef5
fix: Fixes download issues on cancellation, download status logs, con…
islathehut Jan 2, 2025
1d4c36e
Publish
islathehut Jan 2, 2025
c88c86f
Update packages CHANGELOG.md
islathehut Jan 2, 2025
2ca7119
fix(2679): Fix issue with download buttons missing from large files (…
islathehut Jan 7, 2025
f771ee5
Publish
islathehut Jan 7, 2025
92a4bb1
Update packages CHANGELOG.md
islathehut Jan 7, 2025
0673380
Add back debug logging
islathehut Jan 8, 2025
5be3a97
Publish
islathehut Jan 8, 2025
ddd7213
Update packages CHANGELOG.md
islathehut Jan 8, 2025
9fefb99
Fix/download connection issues (#2691)
islathehut Jan 14, 2025
819d98b
Publish
islathehut Jan 14, 2025
ecf25c3
Update packages CHANGELOG.md
islathehut Jan 14, 2025
53cec68
Add timeouts (optional) and make more iterators abortable (#2694)
islathehut Jan 15, 2025
803ca64
Publish
islathehut Jan 15, 2025
d7d480c
Update packages CHANGELOG.md
islathehut Jan 15, 2025
b1fee6d
Fix/more connection nonsense (#2695)
islathehut Jan 16, 2025
36e2084
Publish
islathehut Jan 16, 2025
e0182cf
Update packages CHANGELOG.md
islathehut Jan 16, 2025
c7ec228
Add mplex (#2696)
islathehut Jan 16, 2025
5a50930
Publish
islathehut Jan 16, 2025
8f25f96
Update packages CHANGELOG.md
islathehut Jan 16, 2025
0e308e0
Update mplex config and improve logging (#2701)
islathehut Jan 17, 2025
790d425
Publish
islathehut Jan 17, 2025
d999e6f
Update packages CHANGELOG.md
islathehut Jan 17, 2025
e811c00
Return when already downloading a file (#2702)
islathehut Jan 17, 2025
c3f1134
Publish
islathehut Jan 17, 2025
405470d
Update packages CHANGELOG.md
islathehut Jan 17, 2025
fd243ff
chore(2672): Update directories and S3 bucket for 3.0 release (#2706)
islathehut Jan 21, 2025
75ba441
Merge branch 'develop' into 3.0.0
islathehut Jan 21, 2025
5bfc52d
Publish
islathehut Jan 21, 2025
3a7ee43
Update packages CHANGELOG.md
islathehut Jan 21, 2025
371e032
Update build.gradle
islathehut Jan 21, 2025
c1ea28f
Publish
islathehut Jan 21, 2025
40a5cf3
Publish
islathehut Jan 21, 2025
fcaa17e
Update packages CHANGELOG.md
islathehut Jan 21, 2025
66a29f7
Publish
islathehut Jan 21, 2025
aad7d96
Publish
islathehut Jan 21, 2025
7e36e49
Update packages CHANGELOG.md
islathehut Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix/download connection issues (#2691)
* Testing changes

* A couple more changes

* Refactor file manager service, fix cancel crash, tweak logging

* This might fix the files not being downloadable...

* Remove these patches

* Run backend prepare to figure out why its failing

* I'm dumb

* I'm really dumb

* Not sure why this fails on CI

* Don't send canceled status for malicous downloads and fix tests

* Forgot this

* Update mobile-deploy-ios-test.yml

* Update action.yml
  • Loading branch information
islathehut authored Jan 14, 2025
commit 9fefb998f30b0bbc82fc39df24a569ee9e27e74f
2 changes: 1 addition & 1 deletion .github/workflows/mobile-deploy-ios-test.yml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
uses: ./.github/actions/setup-env
with:
cachePrefix: "deploy-ios"
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle"
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle,helia"

- name: Install pod dependencies
run: |
27 changes: 27 additions & 0 deletions packages/backend/src/nest/common/utils.ts
Original file line number Diff line number Diff line change
@@ -280,3 +280,30 @@ export const createArbitraryFile = (filePath: string, sizeBytes: number) => {

stream.end()
}

// Shamelessly stolen from https://github.com/whatwg/streams/issues/1255#issuecomment-2442964298
// This is necessary because AsyncIterators are fickle and if you just wrap them in a try/catch or try to use
// catch/then/finally on a wrapper promise it ultimately generates an unhandled rejection. JS is so much fun.
export function abortableAsyncIterable<T, TReturn, TNext>(
iter: AsyncIterable<T>,
signal: AbortSignal
): AsyncIterable<T> {
const abortedPromise = new Promise<IteratorResult<T, TReturn>>((resolve, reject) => {
if (signal.aborted) {
reject(new DOMException('aborted', 'AbortError'))
}
signal.addEventListener('abort', () => reject(new DOMException('aborted', 'AbortError')))
})
abortedPromise.catch(() => {})
return {
[Symbol.asyncIterator]: () => {
const inner = iter[Symbol.asyncIterator]()
const { return: _return, throw: _throw } = inner
return {
next: (...args) => Promise.race([inner.next(...args), abortedPromise]),
return: _return ? (...args) => _return.apply(inner, args) : undefined,
throw: _throw ? (...args) => _throw.apply(inner, args) : undefined,
}
},
}
}
Original file line number Diff line number Diff line change
@@ -109,10 +109,17 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
}

async onModuleInit() {
process.on('unhandledRejection', error => {
this.logger.error(error)
throw new Error()
process.on('unhandledRejection', reason => {
// console.log(`why won't this log rejection`, (reason as any).message)
this.logger.error(`Unhandled rejection`, reason)
throw new Error(`Unhandled Rejection`)
})

process.on('uncaughtException', error => {
this.logger.error(`Unhandled exception`, error)
throw new Error(`Unhandled Exception`)
})

// process.on('SIGINT', function () {
// // This is not graceful even in a single percent. we must close services first, not just kill process %
// // this.logger.info('\nGracefully shutting down from SIGINT (Ctrl-C)')
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const TRANSFER_SPEED_SPAN = 10
export const UPDATE_STATUS_INTERVAL = 1
export const BLOCK_FETCH_TIMEOUT = 60
/**
* FIXME: Due to #1684, we've reduced this from 40 to 1 as a quick
* fix.
*/
export const QUEUE_CONCURRENCY = 1
export const TRANSFER_SPEED_SPAN_MS = 10_000 // 10 seconds
export const TRANSFER_SPEED_SPAN = TRANSFER_SPEED_SPAN_MS / 1000
export const UPDATE_STATUS_INTERVAL_MS = 1_000 // 1 second

// Not sure if this is safe enough, nodes with CID data usually contain at most around 270 hashes.
export const MAX_EVENT_LISTENERS = 300
export const MAX_EVENT_LISTENERS = 600

// 1048576 is the number of bytes in a block uploaded via unixfs
// Reference: packages/backend/node_modules/@helia/unixfs/src/commands/add.ts
export const DEFAULT_CAT_BLOCK_CHUNK_SIZE = 1048576 * 10
Original file line number Diff line number Diff line change
@@ -434,27 +434,9 @@ describe('IpfsFileManagerService', () => {
expect(eventSpy).toHaveBeenNthCalledWith(5, IpfsFilesManagerEvents.DOWNLOAD_FILE, uploadMetadata)
}, 10_000)

await waitForExpect(() => {
expect(eventSpy).toHaveBeenNthCalledWith(6, StorageEvents.DOWNLOAD_PROGRESS, {
cid: expect.stringContaining('bafk'),
downloadProgress: { downloaded: 15847, size: 15847, transferSpeed: 0 },
downloadState: 'downloading',
mid: 'id',
})
}, 20_000)

await waitForExpect(() => {
expect(eventSpy).toHaveBeenNthCalledWith(7, StorageEvents.DOWNLOAD_PROGRESS, {
cid: expect.stringContaining('bafk'),
downloadProgress: { downloaded: 15847, size: 15847, transferSpeed: 0 },
downloadState: 'completed',
mid: 'id',
})
}, 20_000)

await waitForExpect(() => {
expect(eventSpy).toHaveBeenNthCalledWith(
8,
6,
StorageEvents.MESSAGE_MEDIA_UPDATED,
expect.objectContaining({
cid: expect.stringContaining('bafk'),
@@ -464,11 +446,21 @@ describe('IpfsFileManagerService', () => {
name: 'test-image',
size: 15847,
width: 824,
path: expect.stringContaining('.png'),
})
)
}, 20_000)

expect(eventSpy).toBeCalledTimes(8)
await waitForExpect(() => {
expect(eventSpy).toHaveBeenNthCalledWith(7, StorageEvents.DOWNLOAD_PROGRESS, {
cid: expect.stringContaining('bafk'),
downloadProgress: { downloaded: 15847, size: 15847, transferSpeed: 0 },
downloadState: 'completed',
mid: 'id',
})
}, 20_000)

expect(eventSpy).toBeCalledTimes(7)
})

// this case causes other tests to fail
Loading
Loading