File: lib/api/files.ts
Description
When PATCH /api/marti/package/:uid is called with only keywords (no channels),
the handler calls api.Files.update() which updates keyword metadata on the TAK server.
As a side effect, the TAK server clears the Groups field for that package hash, so any
channel assignment made during the original upload is lost.
Observed behaviour
- Upload package with
?groups=UTL+-+Utilities → channels correctly shows ['UTL - Utilities']
- PATCH with
{"keywords": [...]} → channels resets to []
Impact
It is currently impossible to set both keywords AND a channel assignment on a package
using sequential POST + PATCH calls without either creating a duplicate entry (dfpc-coe/CloudTAK#1574)
or losing the channel (this bug).
Workaround
Set both keywords and groups together on the initial POST using repeated query
parameters — the same format the CloudTAK UI uses:
POST /api/marti/package
?name=Kaikoura+100y+Inundation+Floodmap
&groups=UTL+-+Utilities
&keywords=Canterbury
&keywords=Kaikoura
&keywords=Inundation
&keywords=Floodmap
This sets keywords and channel correctly in a single request with no duplicate and
no subsequent PATCH needed.
File:
lib/api/files.tsDescription
When
PATCH /api/marti/package/:uidis called with onlykeywords(nochannels),the handler calls
api.Files.update()which updates keyword metadata on the TAK server.As a side effect, the TAK server clears the
Groupsfield for that package hash, so anychannel assignment made during the original upload is lost.
Observed behaviour
?groups=UTL+-+Utilities→ channels correctly shows['UTL - Utilities']{"keywords": [...]}→ channels resets to[]Impact
It is currently impossible to set both keywords AND a channel assignment on a package
using sequential POST + PATCH calls without either creating a duplicate entry (dfpc-coe/CloudTAK#1574)
or losing the channel (this bug).
Workaround
Set both
keywordsandgroupstogether on the initial POST using repeated queryparameters — the same format the CloudTAK UI uses:
This sets keywords and channel correctly in a single request with no duplicate and
no subsequent PATCH needed.