Skip to content

Improved Google Chat thread handling#1376

Merged
caronc merged 3 commits intomasterfrom
1372-google-chat-thread-fix
Jul 30, 2025
Merged

Improved Google Chat thread handling#1376
caronc merged 3 commits intomasterfrom
1372-google-chat-thread-fix

Conversation

@caronc
Copy link
Owner

@caronc caronc commented Jul 29, 2025

Description:

Related issue (if applicable): #1372

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use tox -e lint)
  • 100% test coverage (use tox -e minimal)

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@1372-google-chat-thread-fix

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  "gchat://workspace/key/token/threadkey"

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.65%. Comparing base (8e1dad9) to head (c2a8c49).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1376   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         170      170           
  Lines       21993    21994    +1     
  Branches     3470     3470           
=======================================
+ Hits        21917    21918    +1     
  Misses         68       68           
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# Prepare our URL Parameters
"token": self.webhook_token,
"key": self.webhook_key,
"messageReplyOption" : "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this only be set when the user sets a threadId? This option seems to require a threadID, and without one it would error out:

$ apprise -vvv -b "Test444" "gchat://<workspace>/<key>/<token>"
2025-07-29 18:20:06,751 - DEBUG - Could not load translation path: /home/junhan/apprise/lib/python3.10/site-packages/apprise/i18n/en
2025-07-29 18:20:06,984 - DEBUG - Notification Plugin 119(s) and 165 Schema(s) loaded in 0.2276s
2025-07-29 18:20:06,985 - DEBUG - Loaded Google Chat URL: gchat://A...o/A...I/t...c/?format=markdown&overflow=upstream
2025-07-29 18:20:06,985 - DEBUG - Google Chat POST URL: https://chat.googleapis.com/v1/spaces/<workspace>/messages (cert_verify=True)
2025-07-29 18:20:06,985 - DEBUG - Google Chat Parameters: {'token': <token>', 'key': '<key>', 'messageReplyOption': 'REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD'}
2025-07-29 18:20:06,985 - DEBUG - Google Chat Payload: {'text': 'Test444'}
2025-07-29 18:20:08,080 - WARNING - Failed to send Google Chat notification: Bad Request - Unsupported Parameters., error=400.
2025-07-29 18:20:08,081 - DEBUG - Response Details:
b'{\n  "error": {\n    "code": 400,\n    "message": "The request does not specify which message to reply to.",\n    "status": "INVALID_ARGUMENT"\n  }\n}\n'

@caronc caronc merged commit 18255eb into master Jul 30, 2025
17 checks passed
@caronc caronc deleted the 1372-google-chat-thread-fix branch August 1, 2025 22:29
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.

2 participants