Skip to content

fix(types): a customised built-in type keeps its name - #560

Merged
ibrahimroshdy merged 3 commits into
mainfrom
fix/customised-type-keeps-its-name
Nov 14, 2026
Merged

ibrahimroshdy merged 3 commits into
mainfrom
fix/customised-type-keeps-its-name

Conversation

@ibrahimroshdy

Copy link
Copy Markdown
Collaborator

After Customise on a built-in type (say Network device), its things showed "No type", MCP get_thing returned "type": null, and reports, search results, the map and share links lost the type's name.

Closes #546.

The copy was always stored right: name stays empty until someone renames it, and copied_from_id points at the built-in, so the name follows each reader's language. The readers that used only the copy's own builtin_key (empty on a copy) now go through one helper, typeKeySql() in types/graph.ts, which falls back to the source's key: the thing page and rows (and so get_thing), search results, place contents and group-by-type, the things list and CSV, reports and their type filter, the map and graph, room matching, the phone's sync snapshot, and share links (kept.share_thing_json, migration 0178, CREATE OR REPLACE with the same signature and grants). A renamed copy still shows its own name.

Copies already made need no data change: once upgraded, their things show the right type again.

On the second comment: Change type does offer the copy; it leaves out the thing's current type on purpose, so on a thing that already is a Network device it isn't listed. The web test pins that in English and German.

Not in this PR

  • The Type filter lists both the built-in and the account's copy, so a customised type appears twice (filtering by the original matches nothing in that account). Pre-existing; hiding the original is only safe with one account in view.
  • Search by German type names doesn't work for any built-in (search_names hold English and Arabic only). Pre-existing.

Definition of done

  • Tests: types/customised-name.test.ts (8; 6 failed before the fix): the thing page, get_thing, search in English and Arabic, place contents, list and CSV, a German report and its filter, map, graph, snapshot, share link, a renamed copy. Related server suites 481 pass. Web customised-type.test.tsx (4). Fast gate green.
  • Docs: one sentence in users/things.md.
  • Catalogues: n/a (no new strings).
  • KEPT_* settings: n/a.
  • Security-relevant: no (share-link function keeps its signature, owner and grants).
  • Roadmap: Customised built-in type has no name: "No type" on the thing page and type null over MCP #546 on 1.14.8.

@ibrahimroshdy
ibrahimroshdy requested a review from a team as a code owner November 14, 2026 00:16
@ibrahimroshdy ibrahimroshdy added this to the 1.14.8 milestone Nov 14, 2026
@ibrahimroshdy ibrahimroshdy added bug Something doesn't work as it should area: server API, database and jobs (apps/server) labels Nov 14, 2026
Customise copies a built-in into the account with no name of its own,
pointing at the built-in through copied_from_id, so the copy still reads
in each person's language. The types list resolved that; the thing page,
get_thing, search results, place contents, the things list and its CSV,
reports, the map, the graph, the phone's snapshot and share links read
the copy's own builtin_key, which is NULL, and showed "No type".

Every reader now names a type through typeKeySql (types/graph.ts): its
own key, else its source's. Migration 0178 does the same in
kept.share_thing_json. Copies already made need no data change; their
rows were right, only the readers were wrong.

Signed-off-by: Ibrahim Roshdy <22573766+ibrahimroshdy@users.noreply.github.com>
…le (#546)

A thing's type now carries its built-in's key for a customised copy too,
so useIsVehicle took Power tool's key as the whole answer and no longer
walked the account's types. A copy put under Vehicle lost its vehicle
tabs while the server (kept.is_vehicle_type) still called it a vehicle.
Any type that isn't a vehicle by its key is now walked over the
account's types.

Signed-off-by: Ibrahim Roshdy <22573766+ibrahimroshdy@users.noreply.github.com>
…lt-in (#546)

A copy and its built-in share a key, so grouping a place's contents by
type gave them one group key and their things interleaved under repeated
headers. The key is now the type's name or key, then its id, as the
things list does. The tests for the map, the graph, the snapshot and
share links are split so each fails on its own, and the share link is
read through its public page.

Signed-off-by: Ibrahim Roshdy <22573766+ibrahimroshdy@users.noreply.github.com>
@ibrahimroshdy
ibrahimroshdy force-pushed the fix/customised-type-keeps-its-name branch from b731a80 to 6167d4b Compare November 14, 2026 00:34
@ibrahimroshdy
ibrahimroshdy merged commit 52a19f0 into main Nov 14, 2026
21 checks passed
@ibrahimroshdy
ibrahimroshdy deleted the fix/customised-type-keeps-its-name branch November 14, 2026 00:49
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: server API, database and jobs (apps/server) bug Something doesn't work as it should

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Customised built-in type has no name: "No type" on the thing page and type null over MCP

1 participant