fix(talk): address remaining PR #741 reviewer feedback
Closes the seven outstanding items from the @claude review on PR #741: 1. Add empty `tests/client/talk/__init__.py` for pytest discovery parity with `tests/client/{collectives,news}/`. 2. Standardise boolean query params to integers — `includeStatus` was the string `"true"` in `list_conversations`/`list_participants` while every other flag (`noStatusUpdate`, `lookIntoFuture`, `setReadMarker`, `includeLastKnown`) used `1`/`0`. 3. Replace the `app:install || app:enable` chain in the spreed install hook with `app:install --keep-disabled --force || true; app:enable spreed`, so unrelated install failures surface as a clear "app not found" from `app:enable` rather than being silently masked. 4. Add `_validate_token()` (alphanumeric whitelist) and call it from all six TalkClient methods that interpolate the token into a URL path — defence-in-depth against pathological tokens reaching httpx. 5. Rename `TalkConversation.type` to `room_type` with `Field(alias="type")` and `populate_by_name=True`, so the field no longer shadows Python's builtin while preserving spreed's wire format on input. MCP responses now serialize `room_type` (field name) instead of `type`. 6. `mark_as_read` now passes `json=body or None` so the bodyless "mark everything as read" call doesn't send a spurious `{}` body and `Content-Type: application/json` header. 7. `_validate_message_text` rejects whitespace-only messages, not just empty strings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
9614c0b361
commit
f075540232
@@ -4,11 +4,19 @@ set -euox pipefail
|
||||
|
||||
# Talk (spreed) ships its appstore release on demand; on a fresh container the
|
||||
# app is not yet installed, so app:install pulls it. On rebuilds where the
|
||||
# volume already has it, app:install would fail, so fall through to
|
||||
# app:enable.
|
||||
# volume already has it, app:install fails with "already installed" — that
|
||||
# specific failure is benign, hence the trailing `|| true`. We then run
|
||||
# app:enable separately, which is the action that actually has to succeed.
|
||||
#
|
||||
# Caveat: this `||` also masks unrelated install failures (network outage,
|
||||
# bad version pin, etc.) — they will fall through to app:enable, which
|
||||
# will then fail with a clearer "app not found" error. Acceptable for a
|
||||
# dev-fixture script; do not copy this pattern into production tooling.
|
||||
php /var/www/html/occ app:install spreed || php /var/www/html/occ app:enable spreed
|
||||
# This split (install || true; then enable) is preferred over the previous
|
||||
# `app:install || app:enable` chain because:
|
||||
# - `--keep-disabled` keeps install side-effects strictly to fetching/extracting
|
||||
# the app, so the enable step is the single source of truth for whether the
|
||||
# app is active.
|
||||
# - `--force` skips the compatibility check, locking the script to spreed's
|
||||
# current behaviour rather than the appstore's view of NC compatibility.
|
||||
# - If app:install dies for an unrelated reason (network outage, appstore
|
||||
# unreachable on a fresh install), app:enable now fails with the clearer
|
||||
# "app not found" rather than the install-time error being masked entirely.
|
||||
php /var/www/html/occ app:install spreed --keep-disabled --force || true
|
||||
php /var/www/html/occ app:enable spreed
|
||||
|
||||
Reference in New Issue
Block a user