Skip to content

Commit 6754d96

Browse files
author
Shahak Yosef
committed
Merged PR 108503: Avoid sending another /load to the FE if one was already sent
A client has been reporting "content is not available" issues for some time. We notice in their logs that several load requests are sent to the front end with only 66 millisecond between them. We believe that this is causing a timing issue in the front end and so we add a throttle on the load requests. ## Notes for reviewers: I am not sure if there can be any valid use case for multiple load requests in short intervals. Can it negatively affect valid uses cases of bootstrap -> embed -> potentially reload flows?
1 parent e449934 commit 6754d96

File tree

16 files changed

+89
-58
lines changed

16 files changed

+89
-58
lines changed

dist/powerbi-client.d.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.14.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.14.1 | (c) 2016 Microsoft Corporation MIT */
22
declare module "util" {
33
import { HttpPostMessage } from 'http-post-message';
44
/**
@@ -93,6 +93,14 @@ declare module "util" {
9393
* Returns random number
9494
*/
9595
export function getRandomValue(): number;
96+
/**
97+
* Returns the time interval between two dates in milliseconds
98+
* @export
99+
* @param {Date} start
100+
* @param {Date} end
101+
* @returns {number}
102+
*/
103+
export function getTimeDiffInMilliseconds(start: Date, end: Date): number;
96104
}
97105
declare module "config" {
98106
/** @ignore */ /** */
@@ -301,6 +309,11 @@ declare module "embed" {
301309
* @hidden
302310
*/
303311
frontLoadHandler: () => any;
312+
/**
313+
* The time the last /load request was sent
314+
* @hidden
315+
*/
316+
lastLoadRequest: Date;
304317
/**
305318
* Creates an instance of Embed.
306319
*
@@ -1208,13 +1221,6 @@ declare module "report" {
12081221
private isMobileSettings(settings);
12091222
}
12101223
}
1211-
declare module "defaults" {
1212-
import * as models from 'powerbi-models';
1213-
/** @hidden */
1214-
export abstract class Defaults {
1215-
static defaultQnaSettings: models.IQnaSettings;
1216-
}
1217-
}
12181224
declare module "create" {
12191225
import * as service from "service";
12201226
import * as models from 'powerbi-models';

dist/powerbi.js

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ var ghPages = require('gulp-gh-pages'),
33
header = require('gulp-header'),
44
help = require('gulp-help-four'),
55
rename = require('gulp-rename'),
6-
concat = require('gulp-concat'),
76
uglify = require('gulp-uglify'),
87
replace = require('gulp-replace'),
9-
sourcemaps = require('gulp-sourcemaps'),
108
tslint = require("gulp-tslint"),
119
ts = require('gulp-typescript'),
1210
flatten = require('gulp-flatten'),

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.14.0",
3+
"version": "2.14.1",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"typings": "dist/powerbi-client.d.ts",
@@ -34,14 +34,12 @@
3434
"del": "^2.2.2",
3535
"es6-promise": "^3.2.1",
3636
"gulp": "^4.0.2",
37-
"gulp-concat": "^2.6.0",
3837
"gulp-flatten": "^0.2.0",
3938
"gulp-gh-pages": "^0.5.4",
4039
"gulp-header": "^1.8.7",
4140
"gulp-help-four": "^0.2.3",
4241
"gulp-rename": "^1.2.2",
4342
"gulp-replace": "^0.5.4",
44-
"gulp-sourcemaps": "^1.6.0",
4543
"gulp-tslint": "^4.3.4",
4644
"gulp-typedoc": "^2.0.0",
4745
"gulp-typescript": "^2.12.1",

src/bookmarksManager.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import * as service from './service';
22
import * as embed from './embed';
33
import * as models from 'powerbi-models';
4-
import * as wpmp from 'window-post-message-proxy';
5-
import * as hpm from 'http-post-message';
64
import * as utils from './util';
75
import * as errors from './errors';
8-
import { IPageNode, Page } from './page';
9-
import { Defaults } from './defaults';
10-
import { IReportLoadConfiguration } from 'powerbi-models';
116

127
/**
138
* APIs for managing the report bookmarks.

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @ignore *//** */
22
const config = {
3-
version: '2.14.0',
3+
version: '2.14.1',
44
type: 'js'
55
};
66

src/create.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as service from './service';
22
import * as models from 'powerbi-models';
33
import * as embed from './embed';
44
import * as utils from './util';
5-
import { Defaults } from './defaults';
65

76
/**
87
* A Power BI Report creator component

src/dashboard.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as service from './service';
22
import * as embed from './embed';
33
import * as models from 'powerbi-models';
4-
import * as wpmp from 'window-post-message-proxy';
5-
import * as hpm from 'http-post-message';
6-
import * as utils from './util';
7-
import { Defaults } from './defaults';
84

95
/**
106
* A Dashboard node within a dashboard hierarchy

src/defaults.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)