Skip to content
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

Investigate if integrations info parameter is being sent correctly #19

Closed
TheUnderScorer opened this issue Nov 24, 2022 · 4 comments
Closed
Assignees
Labels

Comments

@TheUnderScorer
Copy link
Contributor

No description provided.

@makma
Copy link
Member

makma commented Nov 24, 2022

When sending the identification request, the package name in the ii query string parameter contains a URL encoded (%40) at the sign (@).

Current value: https://api.fpjs.io/?ci=js/3.8.1&ii=%40fingerprintjs/fingerprintjs-pro-svelte/1.0.0&ii=fingerprintjs-pro-spa/0.4.1
Expeced value: https://api.fpjs.io/?ci=js/3.8.1&ii=fingerprintjs/fingerprintjs-pro-svelte/1.0.0&ii=fingerprintjs-pro-spa/0.4.1

@necipallef
Copy link

Here is the source of the bug. I think we shouldn't use the package name as the ii parameter, we should create another constant value specifically for this purpose, like below:
const integrationInfoKey = 'fingerprintjs/fingerprintjs-pro-svelte'

@TheUnderScorer
Copy link
Contributor Author

@necipallef it doesn't seem to be the source. Here's how the generated file looks like:

import type { FpjsClientOptions } from '@fingerprintjs/fingerprintjs-pro-spa';

const pkgVersion = '1.1.2';
const pkgName = 'fingerprintjs-pro-svelte';

export function getOptions(options: FpjsClientOptions) {
  const clientOptions: FpjsClientOptions = {
    ...options,
    loadOptions: {
      ...options.loadOptions,
      integrationInfo: [...(options.loadOptions?.integrationInfo ?? []), `${pkgName}/${pkgVersion}`],
    },
  };

  return clientOptions;
}

The tokens are replaced like this:

const tokens = Object.entries({
  __PACKAGE_VERSION__: pkg.version,
  __PACKAGE_NAME__: pkg.name.split('/')[1],
});

so the @ shouldn't even exist in here 😄

@TheUnderScorer
Copy link
Contributor Author

@makma the issue that you mentioned existed previously (introduced in this commit: 5152bcf#diff-b52c72805d25139dbb98c8683c818134b6a29cfdbd1e2be4a7df700a6fb0f68d) but was fixed in 1.1.1,.

I suppose the reason for missing data in retool could be people that still use the old version of this library before the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants