@xuda.io/account_module 1.2.2289 → 1.2.2290
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 +9 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2289,6 +2289,7 @@ export const did_you_know_tips = async function (req, job_id, headers) {
|
|
|
2289
2289
|
};
|
|
2290
2290
|
|
|
2291
2291
|
const _warned_no_account_project_id = new Set();
|
|
2292
|
+
const _warned_no_profile_id = new Set();
|
|
2292
2293
|
|
|
2293
2294
|
export const get_active_account_profile_info = async function (uid, profile_id) {
|
|
2294
2295
|
try {
|
|
@@ -2308,9 +2309,14 @@ export const get_active_account_profile_info = async function (uid, profile_id)
|
|
|
2308
2309
|
let active_account_profile_id = profile_id || acc_obj.account_info?.active_account_profile_id || acc_obj.account_profile_id;
|
|
2309
2310
|
|
|
2310
2311
|
if (!active_account_profile_id) {
|
|
2311
|
-
// Soft-fail: log once and return a degraded response. Callers that need a real
|
|
2312
|
-
// should null-check `account_profile_obj`. The chat widget treats this as anonymous
|
|
2313
|
-
|
|
2312
|
+
// Soft-fail: log once PER ACCOUNT and return a degraded response. Callers that need a real
|
|
2313
|
+
// profile should null-check `account_profile_obj`. The chat widget treats this as an anonymous
|
|
2314
|
+
// visitor and POLLS, so this must dedup (like the account_project_id warning above) or it
|
|
2315
|
+
// spams the log with the same profile-less accounts on every poll.
|
|
2316
|
+
if (!_warned_no_profile_id.has(acc_obj._id)) {
|
|
2317
|
+
_warned_no_profile_id.add(acc_obj._id);
|
|
2318
|
+
console.warn(`[get_active_account_profile_info] acc ${acc_obj._id} has neither active_account_profile_id nor account_profile_id; returning null`);
|
|
2319
|
+
}
|
|
2314
2320
|
return { uid, account_profile_id: null, app_id: acc_obj.account_project_id, is_main: false, account_profile_obj: null };
|
|
2315
2321
|
}
|
|
2316
2322
|
|