Skip to content

Handle missing GM_SPT_ENABLED/GM_RFT_ENABLED flags - #848

Merged
josteink merged 1 commit into
KartikTalwar:masterfrom
arturs-buls:fix/missing-gm-feature-flags
Nov 20, 2026
Merged

josteink merged 1 commit into
KartikTalwar:masterfrom
arturs-buls:fix/missing-gm-feature-flags

Conversation

@arturs-buls

Copy link
Copy Markdown
Contributor

What

Gmail no longer defines window.GM_SPT_ENABLED / window.GM_RFT_ENABLED (both are undefined in the page context now). Because is_new_data_layer() checked for the literal "true", it started returning false, and parse_request_payload was never called. As a result:

  • send_message (and send_scheduled_message) never fire. The /sync/u/0/i/s request is still intercepted, and its payload still has the msg-a: email node with the ^pfg label array, but nothing parses it.
  • /i/fd and /i/bv responses are no longer cached, so gmail.new.get.email_data() loses its XHR-sourced data.
  • is_conversation_view() falls into the classic-Gmail branch.

Changes

  • api.check.is_new_data_layer() / api.check.is_new_gui() now treat an absent flag as enabled and return false only when the flag is explicitly "false". Classic Gmail no longer exists, so "absent" means "new".
  • parse_fd_request_payload / parse_bv_request_payload: once these parsers ran again, some /i/fd responses contained a thread without an email list. The resulting TypeError: fd_emails is not iterable was caught, but it discarded the whole response. Such threads are now skipped and the rest of the response is still parsed.

Tests

  • Updated the is_new_data_layer / is_new_gui checks: undefined now expects true, and "false" still expects false.
  • Added parser tests for fd/bv payloads containing a thread without an email list (expects [], not null). They fail without the fix.
  • tsc, jest (154 passing) and eslint (no errors) are all clean locally.

Verified in a live Gmail session: send_message fires again after the change.

🤖 Generated with Claude Code

Gmail no longer defines window.GM_SPT_ENABLED or window.GM_RFT_ENABLED.
is_new_data_layer() therefore returned false, so request payloads were
never parsed and send_message (plus the /i/fd and /i/bv email-data
caching) silently stopped firing. Treat an absent flag as the new
data layer / GUI, since classic Gmail no longer exists.

With /i/fd and /i/bv parsing active again, a single thread without an
email list threw inside the loop and discarded the whole response.
Skip such threads instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@josteink

Copy link
Copy Markdown
Collaborator

Hey there and thanks for the patch!

LGTM.

I'll have to test it before I merge, but I expect to get that done by tomorrow.

Will publish a new version on npm if merged too.

@josteink

josteink commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

I've reproduced the error. I've tested the fix. Looks good to me.

@josteink
josteink merged commit 14d51a7 into KartikTalwar:master Nov 20, 2026
3 checks passed
@josteink

Copy link
Copy Markdown
Collaborator

Now published on npmjs as v1.1.17.

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