Skip to content

Commit cc4ff97

Browse files
authored
fix(server-core): fix improper requestId retrieval in DAP (#9257)
1 parent 366b037 commit cc4ff97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/cubejs-server-core/src/core/CompilerApi.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ export class CompilerApi {
210210
return true;
211211
}
212212

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

@@ -243,7 +243,6 @@ export class CompilerApi {
243243
const result = {
244244
};
245245
if (filter.memberReference) {
246-
// TODO(maxim): will it work with different data types?
247246
const evaluatedValues = cubeEvaluator.evaluateContextFunction(
248247
cube,
249248
filter.values,
@@ -273,14 +272,14 @@ export class CompilerApi {
273272
* - combining cube and view filters with AND
274273
*/
275274
async applyRowLevelSecurity(query, context) {
276-
const compilers = await this.getCompilers({ requestId: query.requestId });
275+
const compilers = await this.getCompilers({ requestId: context.requestId });
277276
const { cubeEvaluator } = compilers;
278277

279278
if (!cubeEvaluator.isRbacEnabled()) {
280279
return query;
281280
}
282281

283-
const queryCubes = await this.getCubesFromQuery(query);
282+
const queryCubes = await this.getCubesFromQuery(query, context);
284283

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

0 commit comments

Comments
 (0)