Repository navigation
fix(types): a customised built-in type keeps its name - #560
Merged
Merged
Conversation
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
force-pushed
the
fix/customised-type-keeps-its-name
branch
from
November 14, 2026 00:34
b731a80 to
6167d4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After Customise on a built-in type (say Network device), its things showed "No type", MCP
get_thingreturned"type": null, and reports, search results, the map and share links lost the type's name.Closes #546.
The copy was always stored right:
namestays empty until someone renames it, andcopied_from_idpoints at the built-in, so the name follows each reader's language. The readers that used only the copy's ownbuiltin_key(empty on a copy) now go through one helper,typeKeySql()intypes/graph.ts, which falls back to the source's key: the thing page and rows (and soget_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 REPLACEwith 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
search_nameshold English and Arabic only). Pre-existing.Definition of done
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. Webcustomised-type.test.tsx(4). Fast gate green.users/things.md.KEPT_*settings: n/a.