Skip to content

Block on00xxxx datasets from nemar.org sync (alternate_id needed) #265

Closed

Description

@neuromechanist

Problem

OpenNeuro-imported datasets (on00xxxx prefix) are being synced to the nemar.org website database as separate entries. Specifically, on000117 was incorrectly added to nemar.org as its own page.

These datasets should NOT be synced directly because they correspond to existing ds00xxxx datasets on nemar.org. They need an alternate_id mapping (to be developed with Choonhan) before they can be synced.

Root Cause

The publish workflow (admin.ts line ~2846) only blocks xx-prefix (sandbox) datasets from publication:

if (dataset.dataset_id.startsWith("xx")) {
  return c.json({ error: "Cannot publish sandbox datasets" }, 400);
}

There is no equivalent guard for on-prefix datasets. Neither the publish approve flow nor the admin sync run endpoint (admin.ts line ~4720) checks for the on prefix before calling syncDatasetToNemar().

Additionally, nemar-sync.ts itself has no prefix-based filtering.

Resolution

  1. Immediate fix: Add on-prefix guard in two places:

    • Publish approve handler (alongside the existing xx check at line 2846)
    • POST /admin/sync/run endpoint (around line 4742)
    • Both should return a clear error: "OpenNeuro datasets require alternate_id mapping before nemar.org sync"
  2. Manual cleanup: Delete the on000117 record from nemar.org database tables (dataexplorer_dataset, dataexplorer_extra_dataset, dataexplorer_dataset_channel_count, dataexplorer_supplementary_dataset)

  3. Future work: Implement alternate_id support in the nemar.org datapipeline so on00xxxx datasets can be synced as updates to their corresponding ds00xxxx entries (requires coordination with Choonhan)

Affected Components

  • backend/src/routes/admin.ts - publish approve + sync run routes
  • backend/src/services/nemar-sync.ts - sync service (no prefix check)
  • nemar.org database - on000117 incorrectly inserted

Activity

  1. added
    bug
    on Mar 9, 2026
  2. added 2 commits that reference this issue on Mar 10, 2026
    1a16176
    ab1070c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions