Skip to content

refactor(board): make recursive copy fallback explicit - #2370

Open
jonathanwxh-cell wants to merge 1 commit into
cboard-org:masterfrom
jonathanwxh-cell:fix/explicit-board-copy-fallback
Open

jonathanwxh-cell wants to merge 1 commit into
cboard-org:masterfrom
jonathanwxh-cell:fix/explicit-board-copy-fallback

Conversation

@jonathanwxh-cell

@jonathanwxh-cell jonathanwxh-cell commented Oct 16, 2026 •

Copy link
Copy Markdown

Fixes #2362.

Recursive board copying currently relies on the misspelled err.respose condition to fall back to a cached child board on API errors. Remove that condition in both current-master implementations and make the existing fallback explicit. Correcting only the spelling would instead stop copying cached children on 401/500 responses.

Add shared, parameterized tests that exercise both container methods: network/404/401/500 failures still copy the local child and retarget the parent's link; a successful fetch uses the remote child; an unavailable child without a cached copy does not prevent copying a later sibling. Export the Communicator container by name so the same tests exercise it directly.

Validation on Node 22.23.2:

  • All 12 new cases pass against the original fallback logic.
  • A temporary spelling-only change produces four expected failures (401/500 in both implementations). That change was removed.
  • Final focused run: 3 suites and 17 tests pass, including both existing container test files.
  • Changed-file Prettier checks, git diff --check, and the commit hook pass.
  • CircleCI on commit 80efe63: all 63 selected suites, 446 tests, and 65 snapshots pass. Repository-wide formatting, Codacy, and Snyk checks also pass.

The tests use mocked API responses and local/guest copy state; no browser/backend end-to-end run was performed for this behavior-preserving cleanup.

This PR targets current master. #2293 moves the Communicator implementation into hooks/useBoardCrud.js, so the same cleanup will need to be carried over if that refactor lands first. I asked about ownership and the preferred target branch in #2362 before preparing this change.

This branch has not been deployed

No deployments
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.

Remove err.respose typo in recursive board copy fallback

1 participant