@pkcprotocol/pkc-js 0.0.33 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- export declare const version = "0.0.33";
1
+ export declare const version = "0.0.34";
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by config/generate-version.js — do not edit
2
- export const version = "0.0.33";
2
+ export const version = "0.0.34";
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -537,8 +537,32 @@ export class LocalCommunity extends RpcLocalCommunity {
537
537
  const latestComment = this._dbHandler.queryLatestCommentCid();
538
538
  this._dbHandler.commitTransaction();
539
539
  const stats = this._dbHandler.queryCommunityStats();
540
- if (commentUpdateRowsToPublishToIpfs.length > 0)
541
- await this._syncPostUpdatesWithIpfs(commentUpdateRowsToPublishToIpfs);
540
+ if (commentUpdateRowsToPublishToIpfs.length > 0) {
541
+ try {
542
+ await this._syncPostUpdatesWithIpfs(commentUpdateRowsToPublishToIpfs);
543
+ }
544
+ catch (e) {
545
+ const err = e;
546
+ const isMfsTimeout = err.message.includes("Timed out writing to MFS path") || err.message.includes("Timed out removing MFS paths");
547
+ if (isMfsTimeout) {
548
+ // Workaround for ipfs/kubo#10842: deeply nested MFS paths hang, but rm of the community root is fast.
549
+ log.error(`MFS sync stuck for community ${this.address} - auto-nuking /${this.address} and forcing a full republish. See https://github.com/ipfs/kubo/issues/10842 for upstream context.`);
550
+ const kuboRpc = this._clientsManager.getDefaultKuboRpcClient();
551
+ try {
552
+ await kuboRpc._client.files.rm("/" + this.address, {
553
+ recursive: true,
554
+ //@ts-expect-error force is not in FilesRmOptions
555
+ force: true
556
+ });
557
+ }
558
+ catch (rmErr) {
559
+ log.error(`Auto-nuke files.rm of /${this.address} failed:`, rmErr);
560
+ }
561
+ this._dbHandler.forceUpdateOnAllComments();
562
+ }
563
+ throw e;
564
+ }
565
+ }
542
566
  const newPostUpdates = await this._calculateNewPostUpdates();
543
567
  const newModQueue = await this._pageGenerator.generateModQueuePages();
544
568
  const kuboRpcClient = this._clientsManager.getDefaultKuboRpcClient();