Skip to content

fix: Pass an empty array to $.param instead of an empty string when options.query is falsey #14051

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

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

dashed
Copy link
Member

@dashed dashed commented Jul 17, 2019

This is likely being loaded onto customer's browsers

https://github.com/splunk/splunk-sdk-javascript/blob/700d149fba3d5b38db06c0adf8739f5182aaf07d/lib/ui/charting/util.js#L1045-L1056

and is causing this.split is not a function errors due to the way jQuery is building the params by traversing enumerable props and the props from the prototype chain: https://github.com/jquery/jquery/blob/b14ce54334a568eaaa107be4c441660a57c3db24/src/serialize.js#L82

The workaround is to use an empty array instead of an empty string when options.query is falsey. As per jquery's docs: https://api.jquery.com/jQuery.param/

Screen Shot 2019-07-17 at 12 06 58 AM


Fixes JAVASCRIPT-XYZ
Fixes JAVASCRIPT-1ABN

@dashed dashed requested a review from billyvg July 17, 2019 04:15
@dashed dashed self-assigned this Jul 17, 2019
@dashed dashed requested a review from a team July 17, 2019 04:15
Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, I wonder why the errors only started popping up more often this week and why only Firefox.

@dashed dashed merged commit b7baa55 into master Jul 17, 2019
@dashed dashed deleted the rsplit-workaround branch July 17, 2019 15:16
@dashed
Copy link
Member Author

dashed commented Jul 17, 2019

scefali pushed a commit that referenced this pull request Jul 17, 2019
@dashed dashed restored the rsplit-workaround branch July 17, 2019 18:03
@billyvg billyvg deleted the rsplit-workaround branch July 17, 2019 18:04
dashed added a commit that referenced this pull request Jul 17, 2019
@dashed
Copy link
Member Author

dashed commented Jul 17, 2019

Relates to openwpm/OpenWPM#408 and is isolated to Firefox browsers

@@ -166,6 +166,7 @@ export class Client {
let query;
try {
query = $.param(options.query || '', true);
Copy link
Member

Choose a reason for hiding this comment

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

Should we not remove the old line here?

Copy link
Member

Choose a reason for hiding this comment

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

He got it in a separate PR i think

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea I got it here #14061

git stash failed me 😢

HazAT added a commit that referenced this pull request Jul 19, 2019
* master:
  ref(admin): Convert user edit page to react (#14074)
  ref: Remove unused Group.get_oldest_event and legacy events behavior (#14038)
  ref(api): Update DELETE users/ to support hard deleting (#14068)
  test(OrganizationDiscoverSavedQueryDetailTest): Stabilize put test (#14077)
  meta(readme): Sentry logo should link to sentry.io (#14076)
  ref: Remove duplicate column (#14073)
  App platform/update permissions token auth (#14046)
  feat: Support issue IDs as canonical parameters
  ref: Change to new traceparent header for Python SDK (#14070)
  feat: Use option to force-disable transaction events (#14056)
  feat(apm): Register option to force-disable transaction events (#14055)
  Feat/mark sentry app installed put route (#14060)
  ref: Remove unused Group.event_set property  (#14036)
  fix: Filter out groups that are pending deletion/merge from `by_qualified_short_id` (SEN-849)
  fix(ui): Fix resolve/ignore actions for accounts without multi… (#14058)
  Fix: Remove extra $.param introduced in GH-14051 (#14061)
  feat: Use Snuba for Group.from_event_id (#14034)
  fix(ui) Display implicit default sort and default to descending (#14042)
  fix(github) Fix 404s not being handled in repository search (#14030)
  fix: Pass an empty array to $.param instead of an empty string when options.query is falsey (#14051)

# Conflicts:
#	src/sentry/utils/sdk.py
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants