@xuda.io/account_module 1.2.2304 → 1.2.2305
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.
- package/index.mjs +22 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -8208,6 +8208,28 @@ const _nl_one = async (db, docType) => {
|
|
|
8208
8208
|
}
|
|
8209
8209
|
})();
|
|
8210
8210
|
|
|
8211
|
+
// The banner reconcilers (_ensure_billing_hold_banner, _ensure_bounce_suspension_banner,
|
|
8212
|
+
// _clear_bounce_suspension_banner, and the confirm_email cleanup in verify_account) all
|
|
8213
|
+
// select xuda_notification on {uid, topic, read}. With no index Couch full-scans the whole
|
|
8214
|
+
// notification DB on EVERY get_account_data: "No matching index found" plus a full-DB
|
|
8215
|
+
// examine per dashboard load. uid leads (most selective), then topic, then read; the extra
|
|
8216
|
+
// docType / delivery_method clauses those callers add are cheap in-memory filters once
|
|
8217
|
+
// uid + topic have narrowed the set to a handful. Unlike the content DBs above,
|
|
8218
|
+
// xuda_notification is node-local on every box, so this runs unconditionally.
|
|
8219
|
+
(async () => {
|
|
8220
|
+
try {
|
|
8221
|
+
const ret = await db_module.create_couch_index('xuda_notification', {
|
|
8222
|
+
index: { fields: ['uid', 'topic', 'read'] },
|
|
8223
|
+
name: 'idx_notif_uid_topic_read',
|
|
8224
|
+
ddoc: 'idx_notif_uid_topic_read',
|
|
8225
|
+
type: 'json',
|
|
8226
|
+
});
|
|
8227
|
+
if (ret?.error) console.error('[account] xuda_notification uid/topic/read index create failed:', ret.error);
|
|
8228
|
+
} catch (err) {
|
|
8229
|
+
console.error('[account] xuda_notification uid/topic/read index init failed:', err?.message || err);
|
|
8230
|
+
}
|
|
8231
|
+
})();
|
|
8232
|
+
|
|
8211
8233
|
const _nl_fashion_url = (p) => {
|
|
8212
8234
|
const rel = p.custom_url || (p.slug ? '/' + p.slug : '');
|
|
8213
8235
|
return `https://xuda.fashion${rel}`;
|