Commit ff7899f
fix(logging): Specifying resourceNames should fetch logs only from those resources (#1597)
* fix(logging): prevent project ID injection when resourceNames is set When `getEntries` is called with a `resourceNames` array that specifies a logging bucket (particularly one in a different project), the library was incorrectly appending the current project's ID to the array. This resulted in an invalid request, causing the Logging API to reject it with an `INVALID_ARGUMENT` error. The fix adjusts the logic to only inject the default project ID if the `resourceNames` array is explicitly empty. This preserves the expected default behavior of searching within the current project, while respecting user-provided resource names for cross-project queries. Fixes: #1593 * revert and add comment * fix test * by tests failure caused by node version * resolve promisify dependency for node 14 * use relative path to avoid 429 error * bypass unrelated doc check --------- Co-authored-by: Baha Aiman <bahaaiman@google.com>1 parent 9d1d480 commit ff7899f
File tree
4 files changed
+25
-7
lines changed- .github/workflows
- src
- test
4 files changed
+25
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
594 | 593 | | |
595 | 594 | | |
596 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
597 | 598 | | |
598 | 599 | | |
599 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
507 | 524 | | |
508 | 525 | | |
509 | 526 | | |
| |||
0 commit comments