angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Any evocation of fireFunctions.httpsCallable make Angular Zone instable

Open hosuaby opened this issue 4 years ago • 2 comments
trafficstars

Version info

Angular: 12.1.1

Firebase: 9.1.3

AngularFire: 7.1.0

Other (e.g. Ionic/Cordova, Node, browser, operating system): rxjs: 7.2.0

How to reproduce these conditions

Any evocation of fireFunctions.httpsCallable make Angular Zone instable.

Context

In my angular application, I have a code that detects pending tasks executed inside Angular Zone. I noticed after upgrade on 7.1.0 that evocation of httpCallables leave long living tasks in the Zone. This was never an issue before. Even wrapping those calls into ngZone.runOutsideAngular doesn't help. Example:

import {AngularFireFunctions} from '@angular/fire/compat/functions';
//...
  constructor(private readonly fireFunctions: AngularFireFunctions) {
  }

this.fireFunctions.httpsCallable('myFunc')(data); // this code creates a long living task inside zone and make it unstable

Expected behavior

Evocation of httpCallable functions must not make zone unstable.

hosuaby avatar Oct 16 '21 20:10 hosuaby

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Oct 16 '21 20:10 google-oss-bot

not sure if it is related but ... in my case the code below outputs to console only once I could not find a solution to call the same httpsCallable more than one time with success.

myFunc(data){
  return functions.httpsCallable('myFunc')(data)
}
async function foo(inData){
  let res = await lastValueFrom(myFunc({data:inData}))
  console.log(res)
}

foo('aaaaa')
foo('bbbbb')

dsl400 avatar Dec 01 '21 20:12 dsl400