Skip to content

Conversation

@pe4cey
Copy link
Contributor

@pe4cey pe4cey commented Mar 21, 2018

Removes zip usage from the postConnectCmdEpic.

The usage of zip (in this epic) was storing the complete history of the action stream and causing a memory leak.

changelog: Fix memory leak in background job

@Kmaschta
Copy link

Good catch!

export const postConnectCmdEpic = (some$, store) =>
some$
.zip(some$.ofType(CONNECTION_SUCCESS), some$.ofType(UPDATE_SETTINGS))
.concat(some$.ofType(CONNECTION_SUCCESS), some$.ofType(UPDATE_SETTINGS))
Copy link
Member

Choose a reason for hiding this comment

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

I think we want .merge over concat.

@oskarhane
Copy link
Member

oskarhane commented Mar 21, 2018

After thinking about it, we do not want to execute this on every UPDATE_SETTINGS. We only want to do it once, right after we successfully connected to a database.
So the initial intention is correct, but we didn't know that all settings actions were stored forever.
We just want the latest one, after a CONNECTION_SUCCESS happened.

So the flow is:

CONNECTION_SUCCESS -> UPDATE_SETTINGS -> check for post_connect_cmd and execute it

Not sure how to write that in code yet though.

Wait for CONNECTION_SUCCESS and then wait for one SETTINGS_UPDATE and then do the execution
@pe4cey pe4cey merged commit 30b1163 into neo4j:master Mar 21, 2018
@pe4cey pe4cey deleted the remove-rxjs-zip branch March 21, 2018 16:56
myzero1 pushed a commit to myzero1/neo4j-browser that referenced this pull request May 17, 2019
Fix issue where action stream was being stored in memory
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