Commit db95e18
committed
Merged PR 101002: Fixing bootstrap bug.
Fixing a bug where /report/embed message is sent before bootstrap is complete.
**Repo:**
1) Call bootstrap.
2) Call report.embed immediately.
**Timing:**
1) Bootstrap starts.
2) iframe is not loaded yet ('load') event is not fired to the SDK.
3) powerbi.embed starts
4) powerbi.embed calls embedExisting because iframe already exists - it's fine.
5) embedExisting calls embed::load method which sends /report/load message to the SDK
6) iframe is loaded (bootstrap is done).
7) ('load') event handler calls embed::load method which sends /report/load message to the SDK - AGAIN
**Expected:**
/report/load is called one time only.
**Acutal**
/report/load is called twice - first time before iframe is ready is a BUG.
**Fix**
Adding a flag which saves the state of the iframe (loaded/not loaded).
If iframe is not loaded, avoid sending the postMessage.
We need the load method to send the right config when it's called from 'load' event. For that, we save the last config per component, and post the load message with that config.1 parent e81fb4d commit db95e18
File tree
9 files changed
+164
-79
lines changed- dist
- src
- test
9 files changed
+164
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
262 | 271 | | |
263 | 272 | | |
264 | 273 | | |
| |||
376 | 385 | | |
377 | 386 | | |
378 | 387 | | |
379 | | - | |
| 388 | + | |
380 | 389 | | |
381 | 390 | | |
382 | 391 | | |
| |||
1479 | 1488 | | |
1480 | 1489 | | |
1481 | 1490 | | |
1482 | | - | |
| 1491 | + | |
1483 | 1492 | | |
1484 | 1493 | | |
1485 | 1494 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
178 | 188 | | |
179 | 189 | | |
180 | 190 | | |
| |||
244 | 254 | | |
245 | 255 | | |
246 | 256 | | |
| 257 | + | |
247 | 258 | | |
248 | 259 | | |
249 | 260 | | |
| |||
358 | 369 | | |
359 | 370 | | |
360 | 371 | | |
361 | | - | |
362 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
363 | 380 | | |
364 | 381 | | |
365 | 382 | | |
366 | | - | |
| 383 | + | |
367 | 384 | | |
368 | 385 | | |
369 | 386 | | |
370 | 387 | | |
371 | 388 | | |
372 | 389 | | |
373 | 390 | | |
374 | | - | |
| 391 | + | |
375 | 392 | | |
376 | | - | |
377 | 393 | | |
378 | 394 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
382 | 398 | | |
383 | 399 | | |
384 | 400 | | |
| |||
455 | 471 | | |
456 | 472 | | |
457 | 473 | | |
458 | | - | |
| 474 | + | |
459 | 475 | | |
460 | 476 | | |
461 | 477 | | |
| |||
720 | 736 | | |
721 | 737 | | |
722 | 738 | | |
723 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
724 | 743 | | |
725 | 744 | | |
726 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
727 | 748 | | |
728 | 749 | | |
729 | 750 | | |
| |||
806 | 827 | | |
807 | 828 | | |
808 | 829 | | |
809 | | - | |
810 | | - | |
811 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
812 | 833 | | |
813 | 834 | | |
814 | 835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
416 | | - | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
0 commit comments