Skip to content

Commit fe4e591

Browse files
committed
fix: revert accidental importOrganization edit that referenced undefined helper
Bugbot flagged a High Severity ReferenceError in my previous commit 9cf6cb7: stale refactor code sitting in my worktree from an earlier exploration of a `subscribeOrSkip` helper got swept into `git add -A` and landed in the Organization.importOrganization method. The helper was never defined, never imported, and never exported — so the commit compiled but would crash at runtime with `ReferenceError: subscribeOrSkip is not defined` on the first non-simulator-mode call to importOrganization. importOrganization is out of scope for this PR; its improvements live in #1603. Revert that function's "Subscribe to the org store first, then check sync status" block to match origin/v2-rc2 verbatim. All intentional #1600 changes (reconcileOrganization + skipOnUnsynced, governance sync, task intervals, tests) are untouched. Verified by `git diff origin/v2-rc2 -- src/models/organizations/organizations.model.js` now showing only reconcileOrganization changes.
1 parent 9cf6cb7 commit fe4e591

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

src/models/organizations/organizations.model.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,20 +1024,16 @@ class Organization extends Model {
10241024
* @returns {Promise<void>}
10251025
*/
10261026
static async importOrganization(orgUid, isHome = false) {
1027-
// Subscribe-first, then check sync status. This ensures new org stores
1028-
// get subscribed on the first pass so they can begin syncing, and
1029-
// subsequent runs will find them synced and proceed.
1027+
// Subscribe to the org store first, then check sync status.
1028+
// This ensures new org stores get subscribed on the first pass so they can
1029+
// begin syncing, and subsequent runs will find them synced and proceed.
10301030
if (!USE_SIMULATOR) {
1031-
if (
1032-
!(await subscribeOrSkip({
1033-
datalayer,
1034-
storeId: orgUid,
1035-
logger,
1036-
prefix: '[v1]: importOrganization',
1037-
label: 'org',
1038-
action: 'import',
1039-
}))
1040-
) {
1031+
try {
1032+
await datalayer.subscribeToStoreOnDataLayer(orgUid);
1033+
} catch (error) {
1034+
logger.warn(
1035+
`[v1]: Could not subscribe to store for ${orgUid}, skipping import: ${error.message}`,
1036+
);
10411037
return;
10421038
}
10431039

0 commit comments

Comments
 (0)