I have successfully created an unzip onFinalize function that unzips any file copied to storage and then deletes the file. However, I am looking for a way to receive a return value from the onFinalize cloud function in my Angular app or somehow listen for when the process is finished.
Currently, I am using logging, but it can be cumbersome because the REST call to the logger API requires an access token. Unfortunately, it's not possible to refresh the access token after it expires in 3600 seconds (unless the user logs out and logs back in).
Is there a good solution in Angular that does not involve a REST call or require an access token?
export const manageZipArchives = functions
.region("xxxxx")
.runWith({timeoutSeconds: 540, memory: "512MB"})
.storage.bucket("xxxxxxxxx")
.object()
.onFinalize(async (obj: functions.storage.ObjectMetadata) => {
const file = admin
.storage()
.bucket(obj.bucket)
.file(obj.name!);
...
return ok;
});