Skip to content

Fix instance store race condition, hardcoded URL, and minor issues#2778

Merged
yarikoptic merged 1 commit into
bf-2762from
fix-instance-store-issues
Apr 9, 2026
Merged

Fix instance store race condition, hardcoded URL, and minor issues#2778
yarikoptic merged 1 commit into
bf-2762from
fix-instance-store-issues

Conversation

@bendichter
Copy link
Copy Markdown
Member

Summary

Follow-up fixes for #2765:

  • Race condition in instance store: Concurrent fetchInstanceInfo() calls from multiple components now share a single in-flight promise instead of firing duplicate /api/info/ requests
  • Hardcoded URL in HowToCiteTab: dandiUrl computed property was still falling back to https://dandiarchive.org — now uses instanceStore.instanceUrl
  • App-level store initialization: Instance store is now fetched at startup in main.ts so page titles work on all routes (not just those mounting components that call fetchInstanceInfo())
  • Double API call in DownloadDialog: Reordered to use cached instance store fetch before the separate dandiRest.info() call for CLI version info
  • snake_case → camelCase: Fixed local variable naming in HowToCiteTab to match project conventions
  • POSIX-portable grep: Replaced \s with [[:space:]] in lint script for BSD grep compatibility
  • E2E error handling: Added resp.ok check in fetchInstanceConfig()

Test plan

  • npm run lint passes
  • npm run type-check passes
  • Hardcoded identifier lint check passes
  • CI passes

🤖 Generated with Claude Code

- Fix race condition in instance store: deduplicate concurrent
  fetchInstanceInfo() calls by tracking an in-flight promise
- Fix remaining hardcoded dandiarchive.org URL in HowToCiteTab dandiUrl
  computed property — now uses instanceStore.instanceUrl
- Initialize instance store at app startup in main.ts so page titles
  work on all routes, not just those mounting specific components
- Reorder DownloadDialog.vue onMounted to use cached instance store
  fetch before calling dandiRest.info() for CLI version info
- Fix snake_case local variables in HowToCiteTab to use camelCase
- Use POSIX-portable [[:space:]] instead of \s in lint script grep
- Add resp.ok check in E2E fetchInstanceConfig for clearer errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vancouver: cffToVancouver(cffObject.value, instanceName.value),
ieee: cffToIEEE(cffObject.value, instanceName.value),
bibtex: cffToBibTeX(cffObject.value, dandisetVersionIdentifier.value, instanceName.value),
ris: cffToRIS(cffObject.value, dandisetVersionIdentifier.value, instanceName.value),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho it was better before - shorter variables made it easier to read... rationale is not listed among items -- do you see what it was ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake_case → camelCase

@yarikoptic
Copy link
Copy Markdown
Member

I will merge, although that dance with variables isn't clear to me

@yarikoptic yarikoptic merged commit b281f68 into bf-2762 Apr 9, 2026
6 checks passed
@yarikoptic yarikoptic deleted the fix-instance-store-issues branch April 9, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants