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

Synchronous queries are no longer stored in ApiJobStore. #49

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

archolewa
Copy link
Contributor

-- The delay operator considers Observable::onCompleted to be an
"emitted item." Therefore, the job row was still being stored in the
ApiJobStore even when the query was synchronous.

--This has been fixed by replacing delay with a subscription, and/or
zip when appropriate.

);
)
.replay(1);
jobRowUpdatedNotification.connect();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other notifications are hot, and since this observable relies on hot observables, I felt it was safest to also make it hot.

@archolewa archolewa force-pushed the storing-tickets-in-apistore branch 2 times, most recently from 64a68f4 to 3425245 Compare September 23, 2016 21:49
@archolewa
Copy link
Contributor Author

Needs a CHANGELOG.

Copy link
Collaborator

@cdeszaq cdeszaq left a comment

Choose a reason for hiding this comment

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

Looks pretty good, just a couple small things (and a Changelog entry needed, calling out that we're fixing a bug.

.delay(ignored -> preResponseStoredNotification)
.delay(ignored -> jobRowStoredNotification)
.zipWith(jobRowStoredNotification, (preResponse, ignored) -> preResponse)
.zipWith(preResponseStoredNotification, (preResponse, ignored) -> preResponse)
Copy link
Collaborator

Choose a reason for hiding this comment

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

A comment around why we can ignore the other side of these zips would be good.

Copy link
Contributor Author

@archolewa archolewa Sep 26, 2016

Choose a reason for hiding this comment

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

The comment above the stream is supposed to explain it, by explaining that we need to wait until the job row has been stored, and the pre response has been stored before emitting the PreResponse (so we don't care about the value of the notifications, only that they arrived). I can make it more explicit that we're using the zipWith as a gating mechanism if you'd like.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, the "zip as gate" is a little odd, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is, but I don't really know of a better way. Not if we want to release it iff the two observables emit items.

jobs: {[
//'greg' is the UserId hard-coded in TestBinderFactory::buildJobRowBuilder and used for
//all queries created in the test environment.
filters: ["userId-eq[greg]"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason we couldn't just get all of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the job store is prepopulated with jobs for functional tests against the jobs endpoint, so it's not empty.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ahh, ok. Makes sense

@dayamr
Copy link
Collaborator

dayamr commented Sep 23, 2016

After CHANGELOG entry. 👍

Copy link
Collaborator

@cdeszaq cdeszaq left a comment

Choose a reason for hiding this comment

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

👍 once that one line in the changelog gets de-confused

storing the ticket in the ApiJobStore.
* The reason the delay operator didn't stop the update workflow from executing viewed an `Observable::onCompleted` as a message for the purpose of
delays. Since the two observables that that the metadata update it gated on are empty when the query is synchronous, the update metadata workflow
was being updated.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bullet seems... confusing? Could it be cleaned / tightened up a bit?

-- The `delay` operator considers `Observable::onCompleted` to be an
"emitted item." Therefore, the job row was still being stored in the
ApiJobStore even when the query was synchronous.

--This has been fixed by replacing `delay` with a subscription, and/or
zip when appropriate.
@cdeszaq cdeszaq merged commit 7091fc9 into master Sep 27, 2016
@cdeszaq cdeszaq deleted the storing-tickets-in-apistore branch September 27, 2016 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants