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

fix: fall back to mixed parser if the field is missing parser in url parameter #788

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/services/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ export function getValueFromFieldsFilter(filter: AdHocVariableFilter, variableNa
return JSON.parse(filter.value);
} catch (e) {
console.error(`Failed to parse ${variableName}`, e);

// If the user has a URL from before 0.1.4 where detected_fields changed the format of the fields value to include the parser, fall back to mixed parser if we have a value
if (filter.value) {
return {
value: filter.value,
parser: 'mixed',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Right.

}
throw e;
}
}
Expand Down
Loading