-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Clear hydrated stores #785
Conversation
* Create clearHydratedStores() methods for StoreRegistry.js and ReactOnRails.js * Add clearHydratedStores() invocation to #initialize_redux_stores helper
…d ReactOnRails.js * Add JS tests * Remove forgotten console logging
Test needs work. Looking promising! Reviewed 5 of 5 files at r1. node_package/src/ReactOnRails.js, line 45 at r1 (raw file):
node_package/src/ReactOnRails.js, line 144 at r1 (raw file):
node_package/tests/ReactOnRails.test.js, line 138 at r1 (raw file):
We need to be testing /**
* Internally used function to set the hydrated store after a Rails page is loaded.
* @param name
* @param store (not the storeGenerator, but the hydrated store)
*/
setStore(name, store) {
hydratedStores.set(name, store);
}, node_package/tests/StoreRegistry.test.js, line 102 at r1 (raw file):
see comments for ReactOnRails.test.js Comments from Reviewable |
As I already showed in #774, there are parallel requests with ConnectionPool...Will fix other notices. |
* JS tests now use setStore * Move clearHydratedStores method to INTERNALLY USED APIs section
One tiny comment and we need the CHANGELOG entry. Reviewed 3 of 3 files at r2. node_package/src/ReactOnRails.js, line 139 at r2 (raw file):
no parallel requests Comments from Reviewable |
@justin808 It is not a problem to remove word "parallel" form the comment, but could you please tell me why there are "no parallel requests"? I thought in #774 I've showed you that connection can be returned to the pool and any parallel request can check out this connection before current request is finished. |
@udovenko Each connection (really a JS context) can be served from the pool to a thread for running a snippet of JS code. The number of these "connections" can be configured. They do not, as far as I know, share the same context. Thus, only ONE thread at a time has access to the given connection (js context). Does that sound about right? |
@justin808 Yes you're right. Two threads do not share same |
@udovenko, great explanation. We just had different ideas of the potential concurrency issue. I'll merge as-is. |
@justin808 I'm not insisting on leaving this comment. Just wanted to clarify... |
@udovenko Since I merged this, the codeship builds are failing: These are the failing tests: https://app.codeship.com/projects/187011/builds/23942593
What's odd is that Travis is passing. |
@justin808 Is this issue resolved now? I can't open the link you've provided to see what exactly went wrong. And I have no expirience with CodeShip... But before opening PR I launched both JS and RSpect tests two times and they all were green. |
Hi @udovenko. I fixed the problem. It was due to the way that codeship was caching npm modules. Thanks for checking back with me. |
This change is