Skip to content

Conversation

@matty0501
Copy link
Contributor

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/3095424739/90097

📓 Notion: https://www.notion.so/gravitywiz/Doc-Update-GCGS-Feeds-Not-Running-2b600ab68edf802f86bbfa228520f90e

Summary

This snippet disables async on GCGS feeds. This is one of the first troubleshooting steps we recommend when debugging GCGS feed issues. Adding the snippet to the SL will help reference this in the docs and also support tickets.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

A new PHP snippet is added that filters Gravity Forms feed asynchronicity. For feeds with addon_slug 'gp-google-sheets', it forces synchronous processing by returning false from the gform_is_feed_asynchronous hook. Other feeds maintain their existing async behavior.

Changes

Cohort / File(s) Change Summary
Asynchronous Execution Override
gc-google-sheets/gcgs-disable-async.php
New filter callback for gform_is_feed_asynchronous hook registered at priority 50. Returns false to disable async execution for gp-google-sheets addon feeds, while preserving async behavior for all other feeds. Accepts parameters: $is_async, $feed, $entry, $form.

Sequence Diagram

sequenceDiagram
    participant GF as Gravity Forms
    participant Filter as gform_is_feed_asynchronous<br/>Filter
    participant Callback as gcgs-disable-async<br/>Callback
    participant Decision as Async Decision

    GF->>Filter: Check if feed should be async<br/>(gform_is_feed_asynchronous)
    Filter->>Callback: Execute registered callback<br/>(priority 50)
    Callback->>Callback: Check feed['addon_slug']
    alt addon_slug === 'gp-google-sheets'
        Callback-->>Decision: Return false<br/>(force sync)
    else Other addon
        Callback-->>Decision: Return $is_async<br/>(preserve original)
    end
    Decision-->>GF: Async behavior determined
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify filter hook callback signature matches Gravity Forms documentation
  • Confirm addon_slug comparison logic for Google Sheets feeds
  • Review fallback behavior for non-Google Sheets feeds to ensure no unintended side effects

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding a new snippet file to disable async functionality for GCGS feeds, which matches the file addition and primary purpose.
Description check ✅ Passed The description includes both required template sections (Context with ticket/Notion links, and Summary) and provides clear explanation of the snippet's purpose and value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch matty0501-patch-1

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
gc-google-sheets/gcgs-disable-async.php (1)

13-13: Consider adding defensive check for array key access.

While Gravity Forms should always provide the addon_slug key, accessing it directly without validation could generate PHP notices if the feed array is malformed or missing this key.

Apply this diff to add a defensive check:

-	if ( $feed['addon_slug'] === 'gp-google-sheets' ) {
+	if ( ! empty( $feed['addon_slug'] ) && $feed['addon_slug'] === 'gp-google-sheets' ) {
 		return false;
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1e723e and 08c3aec.

📒 Files selected for processing (1)
  • gc-google-sheets/gcgs-disable-async.php (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: PHP Lint (PR)
gc-google-sheets/gcgs-disable-async.php

[warning] 13-13: PHPCS: Found precision alignment of 2 spaces.


[error] 13-13: PHPCS: Multi-line function call not indented correctly; expected 4 spaces but found 2.

🪛 GitHub Check: PHPCS (Files Changed)
gc-google-sheets/gcgs-disable-async.php

[failure] 17-17:
Line indented incorrectly; expected at least 1 tabs, found 2 spaces


[failure] 17-17:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 17-17:
Found precision alignment of 2 spaces.


[failure] 15-15:
Line indented incorrectly; expected 1 tabs, found 2 spaces


[failure] 15-15:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 15-15:
Found precision alignment of 2 spaces.


[failure] 14-14:
Line indented incorrectly; expected at least 2 tabs, found 1


[failure] 14-14:
Tabs must be used to indent lines; spaces are not allowed


[failure] 13-13:
Line indented incorrectly; expected 1 tabs, found 2 spaces


[failure] 13-13:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 13-13:
Found precision alignment of 2 spaces.

🔇 Additional comments (1)
gc-google-sheets/gcgs-disable-async.php (1)

1-11: LGTM! Clear documentation and purpose.

The header documentation clearly explains the snippet's purpose, use case, and installation instructions.

Comment on lines +12 to +18
add_filter( 'gform_is_feed_asynchronous', function( $is_async, $feed, $entry, $form ) {
if ( $feed['addon_slug'] === 'gp-google-sheets' ) {
return false;
}

return $is_async;
}, 50, 4 );
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix indentation to use tabs instead of spaces.

The PHPCS pipeline is failing because the function body uses spaces for indentation instead of tabs, which violates the project's coding standards.

Apply this diff to fix the indentation:

 add_filter( 'gform_is_feed_asynchronous', function( $is_async, $feed, $entry, $form ) {
-  if ( $feed['addon_slug'] === 'gp-google-sheets' ) {
-    return false;
-  }
+	if ( $feed['addon_slug'] === 'gp-google-sheets' ) {
+		return false;
+	}
 
-  return $is_async;
+	return $is_async;
 }, 50, 4 );
🧰 Tools
🪛 GitHub Actions: PHP Lint (PR)

[warning] 13-13: PHPCS: Found precision alignment of 2 spaces.


[error] 13-13: PHPCS: Multi-line function call not indented correctly; expected 4 spaces but found 2.

🪛 GitHub Check: PHPCS (Files Changed)

[failure] 17-17:
Line indented incorrectly; expected at least 1 tabs, found 2 spaces


[failure] 17-17:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 17-17:
Found precision alignment of 2 spaces.


[failure] 15-15:
Line indented incorrectly; expected 1 tabs, found 2 spaces


[failure] 15-15:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 15-15:
Found precision alignment of 2 spaces.


[failure] 14-14:
Line indented incorrectly; expected at least 2 tabs, found 1


[failure] 14-14:
Tabs must be used to indent lines; spaces are not allowed


[failure] 13-13:
Line indented incorrectly; expected 1 tabs, found 2 spaces


[failure] 13-13:
Multi-line function call not indented correctly; expected 4 spaces but found 2


[warning] 13-13:
Found precision alignment of 2 spaces.

🤖 Prompt for AI Agents
In gc-google-sheets/gcgs-disable-async.php around lines 12 to 18, the anonymous
function body uses spaces for indentation which breaks PHPCS; replace the
leading spaces with tabs for each indented line inside the add_filter call
(function body, the if block, return statements, and the closing brace) so
indentation uses tabs consistently and matches the surrounding file style, then
run PHPCS to verify the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants