-
Notifications
You must be signed in to change notification settings - Fork 1
SS-9019 extend possibilities for customization #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
6c313d2 to
c7ce155
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
src/sd-specific.ts
Outdated
|
|
||
| // map categories to items | ||
| const items: IScrollingApiItemTypeSelect[] = categories.map((p) => ({ | ||
| item: "search:category:" + p.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Category item prefix mismatch
Category items are returned with the prefix "search:category:" but the parsing logic checks for "category:". When a user selects a category from the returned items, the item value like "search:category:Foo" won't match the startsWith("category:") check, causing it to fall through to the else branch and be incorrectly treated as a search term instead of a category selection.
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| $parameter_settings_url = sanitize_text_field(get_post_meta($product_id, '_parameters_settings_url', true)); | ||
| if (!empty($parameter_settings_url)) { | ||
| $query_params = array(); | ||
| $query_params['_parameters_settings_url'] = $parameter_settings_url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Wrong query parameter name for parameters settings URL
The query parameter key '_parameters_settings_url' includes a leading underscore, but the description on line 504 states the parameter should be "parameters_settings_url" (without underscore). If the configurator expects the parameter without the underscore prefix (as documented), this URL parameter will be ignored and the feature won't work as intended.
src/sd-specific.ts
Outdated
| result.items = result.items.concat(items); | ||
| } | ||
|
|
||
| console.log(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Debug console.log statement left in production code
The console.log(result) statement logs all scrolling API results to the console on every call to returnAndMapCachedResults. Unlike the other console.log statements in the file which have TODO comments indicating they're placeholders for customization, this one appears to be leftover debug logging that will clutter the browser console in production.
src/sd-specific.ts
Outdated
| } | ||
|
|
||
| const base = | ||
| "https://test1.tarablooms.in/wp-json/custom/v1/graphic-components"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Test server URL hardcoded instead of production URL
The API base URL uses test1.tarablooms.in (a test server), but the documentation comment on line 132 states it should fetch from tarablooms.in (production). This mismatch suggests the test URL was accidentally left in the code. In production, this could cause the graphics API integration to fail if the test server is not accessible or contains different data.
| }, | ||
| })); | ||
| result.items = items; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Categories duplicated on every pagination load more call
The returnAndMapCachedResults function always adds categories to the result items, but it's called by both scrollingApiSetParameters (initial load) and scrollingApiLoadMore (pagination). This causes categories to be included in every "load more" response, resulting in duplicate category items being shown to users on subsequent pages. Categories should only be included on the initial load, not when paginating through products.
Additional Locations (1)
f0c83f2 to
b6b3897
Compare
| } | ||
|
|
||
| await fetchFromGraphicsApi(latestQuery, false); | ||
| return returnAndMapCachedResults(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Race condition in shared state across async operations
The module-level variable latestQuery is modified and then used across an await boundary without protection. If multiple calls to scrollingApiSetParameters or scrollingApiLoadMore occur concurrently (e.g., rapid user input), one call could modify latestQuery while another is awaiting its fetch. When the first call resumes and executes returnAndMapCachedResults(), it accesses cachedResults[latestQuery] using the modified value, which may not exist in the cache yet, causing a TypeError.
Note
Introduces SD-specific scrolling/ecommerce handlers and graphics API integration, plus a new WooCommerce field to pass parameters_settings_url to the configurator.
src/sd-specific.ts:scrollingApiSetParametersandscrollingApiLoadMorefor sourcegraphics.SpecificECommerceApiActionsoverriding cart, sharing link, and scrolling behaviors.specificECommerceApiActionsFactoryanddevelopmentUrlBuilderOptions._parameters_settings_url; saves it and returns viaget_product_dataasquery_params._parameters_settings_url.tsconfig.jsonto includesrc/sd-specific.ts.Written by Cursor Bugbot for commit f6c3c36. This will update automatically on new commits. Configure here.