Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] websocket connecting and patchDB connection monitoring #1738

Merged
merged 25 commits into from
Aug 22, 2022

Conversation

MattDHill
Copy link
Member

No description provided.

@MattDHill MattDHill added this to the 0.3.1.2 milestone Aug 15, 2022
@MattDHill MattDHill marked this pull request as draft August 15, 2022 23:15
map(([connectionFailure, progress]) => {
if (connectionFailure === ConnectionFailure.None) {
return null
} else if (!!progress && progress.downloaded === progress.size) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for else since there are return statements.

@@ -31,7 +32,7 @@ export class MarketplaceListPage {
.pipe(
filter(data => exists(data) && !isEmptyObject(data)),
first(),
switchMapTo(this.marketplaceService.getPackages()),
switchMap(() => this.marketplaceService.getPackages()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be the reason why now it requests packages upon reconnection — as opposed to switchMapTo now getPackages is getting called everytime stream gets here.

.pipe(
debounceTime(420),
tap(cache => {
this.bootstrapper.update(cache)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subscription is now here only to update the bootstrapper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to pass it to patch-db to be added here:

  public cache$ = this.source$.pipe(
    tap(res => this.store.update(res)),
    map(_ => this.store.cache),
    tap(cache => this.bootstrapper.update(cache),
    shareReplay(1),
  )

Because we're not really starting anything here...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm game, will require some thought as to keeping PatchDB generic with regard to initial cache and bootstrapper updating.

@MattDHill MattDHill marked this pull request as ready for review August 18, 2022 22:03
Copy link
Collaborator

@waterplea waterplea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, added a few cosmetic comments.

@@ -1,4 +1,4 @@
import { Component } from '@angular/core'
import { ChangeDetectionStrategy, Component } from '@angular/core'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look like you forgot to use it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I tested it and doesn't work on this page. Will remove the import

// check for updates to EOS and services
this.checkForUpdates(ui)
// show eos welcome message
this.showEosWelcome(ui['ack-welcome'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like our next stop, after this is merged, is to switch this to a declarative modal.

.pipe(
debounceTime(420),
tap(cache => {
this.bootstrapper.update(cache)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to pass it to patch-db to be added here:

  public cache$ = this.source$.pipe(
    tap(res => this.store.update(res)),
    map(_ => this.store.cache),
    tap(cache => this.bootstrapper.update(cache),
    shareReplay(1),
  )

Because we're not really starting anything here...

@MattDHill MattDHill merged commit 3ddeb5f into master Aug 22, 2022
@MattDHill MattDHill deleted the fix/connection-monitoring branch December 12, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants