Skip to content

fix(desks): CSV import no longer erases desk data - #657

Merged
MrYuion merged 1 commit into
developfrom
fix/desk-assets-review
Nov 2, 2026
Merged

MrYuion merged 1 commit into
developfrom
fix/desk-assets-review

Conversation

@MrYuion

@MrYuion MrYuion commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

These review fixes for #656 missed its merge, so develop still has the problems below.

Problem: A concierge CSV import erased desk data. Each row was made into a Desk, which fills every missing column with a default, and those defaults then replaced the matched desk asset's values. A CSV without an images, groups, assigned_to or bookable column removed those values from the desk. The desk CSV export always drops images, so re-importing an export also removed images.

Fix: The CSV import now passes plain rows. Only the columns that are in the CSV change the existing desk.

Other fixes from the same review:

  • Old desk ids: one findDeskByLegacyId helper finds desks for check-in codes, desk links, CSV import and favourites. It replaces four lookups that matched in different ways. Old CSV rows whose map_id is not their id now update their migrated desk and do not make a duplicate.
  • Desks in other buildings: check-in codes and desk links search the org zone, not only the active building. Desk links load the desk's building first, so a desk in a region that is not loaded selects the correct building.
  • Empty scope: the *InZone asset queries return no assets for an empty zone id (for example, before the building loads). Before, they sent an empty zones filter.
  • Mock mode: the mock assets API filters on zones and makes parking spaces for each parking level.
  • Pagination: queryAllAssetPages stops after 100 pages and its query has a type.

Not in this PR: moving the favourites migration into init migrate:desk_assets. That change is in PlaceOS/init.

Tests pass for assets, mocks, bookings, concierge and workplace. The concierge and workplace builds pass.

Reviewed with sol-loop: 3 rounds with gpt-6.1-sol on xhigh. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code). Reviewed by gpt-6.1-sol in Codex.

🤖 Generated with Claude Code

- CSV import passes plain rows, so columns missing from the CSV no longer
  overwrite the matched desk asset with Desk defaults.
- One findDeskByLegacyId helper resolves old desk ids for check-in codes,
  desk links, CSV import and favourites.
- Check-in codes and desk links search the org zone, and desk links load
  the desk's building before they use it.
- Asset InZone queries return nothing for an empty zone id.
- The mock assets API filters on zones and builds parking per level.
- queryAllAssetPages stops after 100 pages and has a typed query.
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

Deployment failed for project frontend-templates with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit

@MrYuion
MrYuion merged commit 118fe45 into develop Nov 2, 2026
1 of 2 checks passed
@MrYuion
MrYuion deleted the fix/desk-assets-review branch November 2, 2026 01:34
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.

1 participant