@rmdes/indiekit-endpoint-activitypub 2.4.0 → 2.4.1

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.
Files changed (2) hide show
  1. package/index.js +21 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1000,18 +1000,27 @@ export default class ActivityPubEndpoint {
1000
1000
  );
1001
1001
  }
1002
1002
 
1003
- // Drop non-sparse indexes if they exist (created by earlier versions),
1004
- // then recreate with sparse:true so multiple null values are allowed.
1005
- this._collections.ap_muted.dropIndex("url_1").catch(() => {});
1006
- this._collections.ap_muted.dropIndex("keyword_1").catch(() => {});
1007
- this._collections.ap_muted.createIndex(
1008
- { url: 1 },
1009
- { unique: true, sparse: true, background: true },
1010
- );
1011
- this._collections.ap_muted.createIndex(
1012
- { keyword: 1 },
1013
- { unique: true, sparse: true, background: true },
1014
- );
1003
+ // Muted collection sparse unique indexes (allow multiple null values)
1004
+ this._collections.ap_muted
1005
+ .dropIndex("url_1")
1006
+ .catch(() => {})
1007
+ .then(() =>
1008
+ this._collections.ap_muted.createIndex(
1009
+ { url: 1 },
1010
+ { unique: true, sparse: true, background: true },
1011
+ ),
1012
+ )
1013
+ .catch(() => {});
1014
+ this._collections.ap_muted
1015
+ .dropIndex("keyword_1")
1016
+ .catch(() => {})
1017
+ .then(() =>
1018
+ this._collections.ap_muted.createIndex(
1019
+ { keyword: 1 },
1020
+ { unique: true, sparse: true, background: true },
1021
+ ),
1022
+ )
1023
+ .catch(() => {});
1015
1024
 
1016
1025
  this._collections.ap_blocked.createIndex(
1017
1026
  { url: 1 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",