TryQuiet / quiet

A private, p2p alternative to Slack and Discord built on Tor & IPFS
https://www.tryquiet.org
GNU General Public License v3.0
1.94k stars 85 forks source link

Clear LevelDB after OrbitDB when leaving a community #2497

Closed leblowl closed 4 months ago

leblowl commented 5 months ago

Received the following log on Android when leaving a community:

04-30 12:56:16.004  4770  4919 E NODEJS-MOBILE: Error: Failed to update peers list - community missing
04-30 12:56:16.004  4770  4919 E NODEJS-MOBILE:     at StorageService.updatePeersList (webpack://@quiet/backend/./src/nest/storage/storage.service.ts?:296:19)
04-30 12:56:16.004  4770  4919 E NODEJS-MOBILE:     at async CertificatesRequestsStore.eval (webpack://@quiet/backend/./src/nest/storage/storage.service.ts?:276:13)
04-30 12:56:16.005  4770  4898 E nodejs  : webpack://@quiet/backend/./src/nest/connections-manager/connections-manager.service.ts?:111
04-30 12:56:16.005  4770  4898 E nodejs  :             throw new Error();
04-30 12:56:16.005  4770  4898 E nodejs  :             ^
04-30 12:56:16.005  4770  4898 E nodejs  : 
04-30 12:56:16.005  4770  4898 E nodejs  : Error
04-30 12:56:16.005  4770  4898 E nodejs  :     at process.eval (webpack://@quiet/backend/./src/nest/connections-manager/connections-manager.service.ts?:111:19)
04-30 12:56:16.005  4770  4898 E nodejs  :     at process.emit (node:events:513:28)
04-30 12:56:16.005  4770  4898 E nodejs  :     at processEmit [as emit] (webpack://@quiet/backend/./node_modules/signal-exit/index.js?:199:34)
04-30 12:56:16.005  4770  4898 E nodejs  :     at emit (node:internal/process/promises:140:20)
04-30 12:56:16.005  4770  4898 E nodejs  :     at processPromiseRejections (node:internal/process/promises:274:27)
04-30 12:56:16.005  4770  4898 E nodejs  :     at processTicksAndRejections (node:internal/process/task_queues:97:32)

It looks like we clear/close LevelDB before closing OrbitDB when leaving a community, but it should be the other way around.

kingalg commented 4 months ago

@leblowl how can I check if it's done? Was it only the log or was it also causing leaving community to break? If it was causing leaving a community to break then it's fixed but if I should also check logs, let me know.

kingalg commented 4 months ago

mobile@2.2.0-alpha.7

After consultation with Lucas. Not happening right now, I'll keep an eye on mentioned error.