cartant / rxjs-spy

A debugging library for RxJS
https://cartant.github.io/rxjs-spy/
MIT License
702 stars 22 forks source link

Tagging is inconsistent #56

Closed jcham closed 3 years ago

jcham commented 3 years ago

Is this project not being maintained anymore?

I find that the tag works only sporadically and have not been able to detect a pattern as to when it does and does not. For example, in the following test:

// -------------------------------------------------------------------------
// rxjs-spy
const spy= create()
spy.log()
it('syncedScrap$ lifetime and shutdown', () => {

  // ---- Setup struct input
  const structScrap$  = new Subject<Partial<Struct_ImageScrap>>()
  mocked(firestoreSyncDocument)
    .mockImplementation((docRef: DocRef) => {

      function d(id: string,
                 struct: Partial<Struct_ImageScrap>,
                 ref: DocRef = { id } as DocRef
      ): DocSnap {
        return ({ id, ref, data: () => struct,} as any) as DocSnap
      }

      if (docRef.id === 'scrap')
        return structScrap$.pipe(
          map(struct => d(docRef.id, struct)),
          tag('structScrap$'),
        )
      return EMPTY
    })

  // ---- Setup Collage producing sync
  const scrap$ = new BehaviorSubject<Scrap|null>(null)
  const s$ = syncedScrap$(firestoreCollageScrap('collage', 'scrap')).pipe(
      tag("syncedScrap$"),
    )
  const subs = s$.subscribe(s => scrap$.next(s))

the tag structScrap$ gets logged but syncedScrap$ does. Am I misunderstanding something?

cartant commented 3 years ago

Is this project not being maintained anymore?

It's not my highest priority. And, as such, I'm not prepared to put in the time required to figure out what your issue is. What's presented above is far from a minimal reproduction of a problem - i.e. there is no possibility of my being able to run that test to reproduce the issue. Maybe if a minimal reproduction of the problem is supplied it could be something simple that could be fixed. 🤷‍♂️ Without that, it's not worth my time. My work on the tools that will replace this project has a higher priority.

jcham commented 3 years ago

Agreed I tried to distill where the problem was but still wasn't able to detect under what conditions the tag doesn't work. I'll do more investigation.

jcham commented 3 years ago

Ah mea culpa, there was a custom operator that was "breaking the chain" in the middle.

cartant commented 3 years ago

That's one of the benefits of creating a minimal repo: sometimes you get to solve the problem yourself, which also saves you time.