Skip to content

[Workspaces] Context variable injector runtime errorΒ #758

@lostie

Description

@lostie

Description

Our operations team has setup a workspace where they have configured some custom filtering on the records displayed in that workspace.

Expected behavior

No error is raised when performing requests with custom filters setup within workspaces

Actual behavior

This custom filter is raising a lot of errors when the requests are made to our app. I don't have much context about the workspace setup or even what workspace is causing the issue since that information is not exposed in the errors that are being raised.

Failure details

This is the Sentry error that is being raised:

Unknown context variable: search2.selectedRecord.email, please check the query for any typos (RuntimeError)

ForestLiana::StatsController#get

Crashed in non-app: forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in block in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_value

forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_value_custom at line 25
forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_value at line 6
forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_filter at line 47
forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in block in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_filter at line 40
forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in map at line 40
forest_liana (9.11.3) app/services/forest_liana/utils/context_variables_injector.rb in ForestLiana::Utils::ContextVariablesInjector.inject_context_in_filter at line 40
forest_liana (9.11.3) app/services/forest_liana/scope_manager.rb in ForestLiana::ScopeManager.inject_context_variables at line 43
forest_liana (9.11.3) app/services/forest_liana/scope_manager.rb in ForestLiana::ScopeManager.append_scope_for_user at line 15
forest_liana (9.11.3) app/services/forest_liana/value_stat_getter.rb in perform at line 9
forest_liana (9.11.3) app/controllers/forest_liana/stats_controller.rb in get at line 32

Context

  • Package Version: 9.11.3
  • Rails Version: 8.0.3
  • Database Dialect: Postgresql
  • Database Version: 17

Notes

FYI, we are not currently able to update the package version to the latest one since it breaks our environment. Relates to #742

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions