Repository navigation
Stop search crashing on repeated session codes within an event - #63
Conversation
The Ignite 2026 catalog lists some sessions once per time slot (77 codes today, mostly labs and lightning talks), so MiniSearch throws "duplicate ID" and every msevents search fails. Index only the first row per event::sessionCode; findSession still returns every slot. Drop the M365 build's unique-code check, which existed only because of this crash. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc8d0c3c-e6a7-4a74-bee9-cf99887b72b5
There was a problem hiding this comment.
🟡 Changes recommended
Code-shaped queries still return duplicate sessions that consume limit slots; deduplicate matches by event and code before limiting, preserve all rows for findSession, and add regression coverage.
1 open issue
What changed in this PR
This PR prevents repeated session codes in event catalogs from crashing the CLI search index and blocking M365 plugin packaging, while preserving individual time slots for session lookup.
Changes:
- Indexs only the first row for each event/session-code pair.
- Adds regression tests for keyword-search deduplication and multi-slot session lookup.
- Allows repeated session codes during M365 catalog validation.
| File | Description |
|---|---|
cli/test/search.test.ts |
Tests repeated-code search and preservation of session time slots. |
cli/src/search/index.ts |
Deduplicates MiniSearch input by event and session code. |
cli/scripts/build-m365-plugin.mjs |
Removes the repeated-code rejection from catalog validation. |
Review effort: Balanced
| index.addAll(sessions.filter((s) => { | ||
| const id = `${s.event}::${s.sessionCode}`; | ||
| if (seen.has(id)) return false; | ||
| seen.add(id); |
There was a problem hiding this comment.
Leaving this as-is on purpose. This PR is only a guard that stops the crash. Repeated codes within one event are a temporary glitch in the Ignite 2026 catalog, and no other event has them, so I'm keeping behavior changes to a minimum. A code query that lists every time slot matches what session <code> shows, and repeats rarely fill the default limit. Catalogs without repeats behave exactly as they do on main.
Build 2025 and Ignite 2025 catalog endpoints now return 404. Drop them from KNOWN_EVENTS and move tests, smoke scripts and the CLI README to the 2026 events. The version bump also ships the duplicate session code crash guard (#63). Co-authored-by: Zane Bong <zanebong@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc8d0c3c-e6a7-4a74-bee9-cf99887b72b5

What does this PR do?
The live Ignite 2026 catalog lists some sessions once per time slot. Today that's 77 codes, mostly labs and lightning talks; for example,
LAB700appears 4 times, each with its ownsessionInstanceIdand start time. The search index usesevent::sessionCodeas its ID, so MiniSearch throwsduplicate ID ignite-2026::BRK101. With 0.3.2, everymsevents sessions/sessioncall fails once the Ignite 2026 catalog is cached.The fix guards against the crash without changing other behavior:
buildIndexindexes only the first row for eachevent::sessionCode. Search results are unchanged, and each session appears once.findSessionstill searches all rows, sosession LAB700 --event ignite-2026lists all 4 time slots.If the catalog stops repeating codes, the guard has no effect. It doesn't bump the CLI version; that's left for the next release PR.
Known gap: when a code repeats within one event, the text output of
session <code>still says "across events" and suggests--event. JSON output isn't affected.Note
This project is maintained by a small team for Microsoft Build. We may not be able to review or accept all contributions — but we appreciate the effort!
Before submitting a PR, consider opening an issue or discussion first. This helps us align on direction before you invest time in code.
Checklist
Validation, run from
cli\:npm run build: passednpm test: passed (73 tests)npx vitest run test/search.test.tswithout the guard: the new test fails withMiniSearch: duplicate ID ignite-2026::LAB700, so the test reproduces the crashnpm run smoke:m365: passedsessions --query agents --event ignite-2026returns results, andsession LAB700 --event ignite-2026lists 4 slotsnpm run build:m365 -- --event ignite-2026 --plugin-version 1.0.7: passed; before this change it failed on repeated codes