Skip to content

Commit

Permalink
fix(server-core): fix improper requestId retrieval in DAP (#9017)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsod90 authored Dec 5, 2024
1 parent 6d82f18 commit 4e366d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/cubejs-server-core/src/core/CompilerApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ export class CompilerApi {
return true;
}

async getCubesFromQuery(query) {
const sql = await this.getSql(query, { requestId: query.requestId });
async getCubesFromQuery(query, context) {
const sql = await this.getSql(query, { requestId: context.requestId });
return new Set(sql.memberNames.map(memberName => memberName.split('.')[0]));
}

Expand Down Expand Up @@ -243,7 +243,6 @@ export class CompilerApi {
const result = {
};
if (filter.memberReference) {
// TODO(maxim): will it work with different data types?
const evaluatedValues = cubeEvaluator.evaluateContextFunction(
cube,
filter.values,
Expand Down Expand Up @@ -273,14 +272,14 @@ export class CompilerApi {
* - combining cube and view filters with AND
*/
async applyRowLevelSecurity(query, context) {
const compilers = await this.getCompilers({ requestId: query.requestId });
const compilers = await this.getCompilers({ requestId: context.requestId });
const { cubeEvaluator } = compilers;

if (!cubeEvaluator.isRbacEnabled()) {
return query;
}

const queryCubes = await this.getCubesFromQuery(query);
const queryCubes = await this.getCubesFromQuery(query, context);

// We collect Cube and View filters separately because they have to be
// applied in "two layers": first Cube filters, then View filters on top
Expand Down

0 comments on commit 4e366d3

Please sign in to comment.