Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
b2e12e7
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
3bef808
fix(storage): gaxios migration system test fix
thiyaguk09 May 12, 2026
65f9f33
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
1ae557f
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
2ad0450
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 May 14, 2026
bd33380
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
cc411a0
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
fbeddaf
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 14, 2026
128bf0a
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
9010041
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
23ad973
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 15, 2026
7b6d68b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0e8f067
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
68ef48f
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 18, 2026
a2cd00b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
72c17d7
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7a7f79a
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 19, 2026
8eb2d72
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
eacb087
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0d254db
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 21, 2026
683b3f4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0c58a9a
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
5ccfd24
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 25, 2026
b5c81a1
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
fe44861
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
b980976
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 26, 2026
7c3ee50
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0a4f5ac
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ccee09f
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 May 27, 2026
ef7c4d4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
e3288e3
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7b15a47
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 1, 2026
eb547c4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
1fba172
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
68f4fa7
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 2, 2026
fafab27
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
d4b912f
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0321f89
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 3, 2026
c5be999
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
c0a6220
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
b1c3540
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 4, 2026
c47559b
refactor: wrap done() callback in arrow function block for consistenc…
thiyaguk09 Jun 5, 2026
4865c5d
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
747d276
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
0f2652b
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
8117684
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 5, 2026
a82723e
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
e366cc2
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ffd2057
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
55f461b
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 12, 2026
8a0e737
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
4f69ca3
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
2d55123
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
afa9dda
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 15, 2026
17ffbe5
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
3b19434
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7d5c5ac
test: add bytes method to mock Gaxios response in acl and headers tests
thiyaguk09 Jun 5, 2026
6a4b6ce
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 17, 2026
9379a79
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
2c0e9c8
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
7d33276
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 18, 2026
fb221c3
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
696a337
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
9aea402
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 19, 2026
c33b9f8
test: update locationType assertion to verify specific bucket instead…
thiyaguk09 Jun 19, 2026
efaaf4b
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
fe055f7
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
36062af
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 22, 2026
e03e122
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
7218474
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
d4ee55c
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
9271939
lint fix
thiyaguk09 Jun 23, 2026
2dfc7ac
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 23, 2026
de6b408
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
20fcb11
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
9519ae8
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
1819fe4
lint fix
thiyaguk09 Jun 23, 2026
1462379
Merge remote-tracking branch 'upstream/storage-node-18' into node18/s…
thiyaguk09 Jun 23, 2026
85c50e2
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
0979efb
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
ba27a8f
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
948d035
lint fix
thiyaguk09 Jun 23, 2026
becfad7
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 24, 2026
fc44591
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
a81e28d
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
018f71e
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
43fc1e8
lint fix
thiyaguk09 Jun 23, 2026
d7dc4a9
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 25, 2026
1946ca8
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
bae6491
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
aeb3a02
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
3217d07
lint fix
thiyaguk09 Jun 23, 2026
816c748
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 26, 2026
6723f3e
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
43fc14b
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
3f1dcdf
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
0d373cf
lint fix
thiyaguk09 Jun 23, 2026
f71547a
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jun 29, 2026
0a993d6
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
4f16b2e
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
dae5c48
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
b1a54b0
lint fix
thiyaguk09 Jun 23, 2026
fc267c2
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 1, 2026
de16592
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
82a2239
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
74e6d6b
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
f41a664
lint fix
thiyaguk09 Jun 23, 2026
beda3ad
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 3, 2026
111aa89
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
eaf8c63
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
a5aac31
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
b4ac2f3
lint fix
thiyaguk09 Jun 23, 2026
fe88ba6
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 7, 2026
9a86b22
feat: disable compression on file download requests and clean up test…
thiyaguk09 Jul 8, 2026
ecc3b50
fix: update storage IAM test members and refine error validation logic
thiyaguk09 Jul 8, 2026
cb468a9
fix: decorate GaxiosError with legacy ApiError properties and update …
thiyaguk09 Jul 8, 2026
20e15b0
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
c9e4407
refactor(storage): remove Service.ts and migrate logic to StorageTran…
thiyaguk09 May 14, 2026
01223bc
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
72b5e10
lint fix
thiyaguk09 Jun 23, 2026
ab8ae17
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 8, 2026
955a99b
Merge branch 'storage-node-18' into node18/system-test
thiyaguk09 Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions handwritten/storage/src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,7 @@ class File extends ServiceObject<File, FileMetadata> {
queryParameters: query as unknown as StorageQueryParameters,
responseType: 'stream',
decompress: options.decompress,
compress: false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any;

Expand Down
31 changes: 25 additions & 6 deletions handwritten/storage/src/storage-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@ export class StorageTransport {
hasEtagInBody
);

// Helper to enrich GaxiosError objects with legacy ApiError properties
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const decorateError = (err: any) => {
if (err && typeof err === 'object') {
err.code = err.response?.status || err.status || err.code;
if (err.response?.data?.error) {
const apiError = err.response.data.error;
if (apiError.message) err.message = apiError.message;
if (apiError.errors) err.errors = apiError.errors;
}
}
return err;
};

try {
const requestPromise = this.authClient.request<T>({
adapter: async (opts: GaxiosOptions) => {
Expand Down Expand Up @@ -236,20 +250,25 @@ export class StorageTransport {
return data;
};

const enrichedPromise = requestPromise.catch(err => {
throw decorateError(err);
});

if (callback) {
requestPromise
enrichedPromise
.then(resp => callback(null, decorateMetadata(resp), resp))
.catch(err => callback(err, null, err.response));
return requestPromise;
return enrichedPromise;
}

return requestPromise;
return enrichedPromise;
} catch (e) {
const err = decorateError(e);
if (callback) {
callback(e as GaxiosError);
return Promise.reject(e);
callback(err as GaxiosError);
return Promise.reject(err);
}
throw e;
throw err;
}
}

Expand Down
3 changes: 1 addition & 2 deletions handwritten/storage/system-test/fixtures/index-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line no-undef
/* eslint-disable node/no-missing-require, no-unused-vars, no-undef */
const {Storage} = require('@google-cloud/storage');

function main() {
// eslint-disable-next-line no-unused-vars
const storage = new Storage();
}

Expand Down
5 changes: 2 additions & 3 deletions handwritten/storage/system-test/fixtures/index-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line no-undef
const {Storage} = require('@google-cloud/storage');
/* eslint-disable node/no-missing-import, no-unused-vars */
import {Storage} from '@google-cloud/storage';

function main() {
// eslint-disable-next-line no-unused-vars
const storage = new Storage();
}

Expand Down
7 changes: 5 additions & 2 deletions handwritten/storage/system-test/kitchen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ describe('resumable-upload', () => {
retryableErrorFn: RETRYABLE_ERR_FN_DEFAULT,
};

const bucket = new Storage({retryOptions}).bucket(bucketName);
const bucket = new Storage({
projectId: process.env.PROJECT_ID,
retryOptions: retryOptions,
}).bucket(bucketName);
let filePath: string;

before(async () => {
Expand Down Expand Up @@ -97,7 +100,7 @@ describe('resumable-upload', () => {
// see: https://cloud.google.com/storage/docs/exponential-backoff:
const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000;
console.info(`retrying "${title}" in ${ms}ms`);
setTimeout(done(), ms);
setTimeout(() => { done(); }, ms);
}

it('should work', done => {
Expand Down
Loading
Loading