not sure yet if this is an actual bug but i have labelled it so because Rules is not updating ALL the views I have set up in Rules. When i execute a nodejs-views rule, rules only updates remote views and not the view on the machine which excuted the action which actioned the Rules event. is this by design? is it because the machine executing the rule is not sending a nodejs message to itself. in the meantime there are workarounds (views_flag_refresh module)

thanks

laurence

Comments

laurencefass created an issue. See original summary.

Syntapse’s picture

Issue summary: View changes
no sssweat’s picture

what rules action are you using?

Syntapse’s picture

the nodejs update view... added by the nodejs module. is the behaviour ive described correct or is there something wrong with my setup? ideally id like to drop views_flag_refresh if possible.

Syntapse’s picture

there is only one nodejs update view rule i can see...

no sssweat’s picture

oops, my bad, I meant to say what react on are you using? (what triggers the rule?)

Syntapse’s picture

im reacting on a variety of events where i need the end result to be an update on the view. i.e. consider it could be anything that updates data in a relevant view. do you want a specific example?

no sssweat’s picture

do you want a specific example?

yes, please.

Syntapse’s picture

node created, user unfriended... pretty much any reaction i set up with a nodejs views update shows on the "other" not where the rule is executed.

Syntapse’s picture

the specific use case i would like to get working is as follows:

a node/view page manager override with a node edit and a node view (list of nodes) on the same page. when i add a node (using whatever means i need to to keep on the page) i update the view with the new node. at the moment only remote screens update using nodejs update view action. as a workaround im using views_flag_refresh to update the local machine (which id rather drop in favour of a single nodejs rules action).

however im not sure if its working to design or meant to update all views - remote and local...

Anonymous’s picture

not sure what you mean by remote or local, but in case this helps, but see this code here:

http://cgit.drupalcode.org/nodejs/tree/nodejs.js#n20

in a nutshell, the node.js module checks for messages that originate on a given socket, and drops them on the return trip. if this is causing an issue, perhaps we could add something to the node.js module that allowed for this to be conditional, perhaps with a flag on the message?

Syntapse’s picture

many thanks

to clarify:

local: the browser which fired the rules reaction.
remote: all other browsers looking at a view affected by a nodejs update view action.

at the moment (in my test cases) the local browser doesnt update its view. is it designed to? or is there a problem with my setup?

Anonymous’s picture

"at the moment (in my test cases) the local browser doesnt update its view": this may be because of the code i linked above.

can you put some debug code in nodejs.js like this:

  if (message.clientSocketId == Drupal.Nodejs.socket.id) {
    console.log(message);
    return;
  }

if you see that log code fire in the local view, then the approach i suggested in #11 will work. if it doesn't, then we have to look at the path of the message from the browser through drupal and the node.js server to figure this out.

Chipie’s picture

@laurencefass: I'm having the same problem. Did you find a solution yet?

Chipie’s picture

@beejbus: I have put the code from #13 in node.js and the log code fires in the local view.

Do you know the message should be dropped when message.clientSocketId == Drupal.Nodejs.socket.id?

Chipie’s picture

If I revert this commit, the local view is also being updated again.

drupal_newb’s picture

I'm having the same problem.

I have a Views comment block and below that I have the Comments form.

When submitting a new Comment, the Views comment block doesn't update on the same page, but if that page is viewed from different machines or the same machine, but different tabs, it updates fine.

#16 fixed it for me! Thanks so much.

delacosta456’s picture

hi
i was having a similar issue with a view with Editable field on it to modify values and and on the right another view that was supposed to refresh when change occur in the editable view..

and #16 fixed it ...

but if it make sense ...that commit is it not for a reason .. ?
instead of reverting i was thinking of changing the code to

if (message.clientSocketId && message.clientSocketId == Drupal.Nodejs.socket.id) {
    return;
  }*/
elseif (message.clientSocketId == Drupal.Nodejs.socket.sessionid){
    return;
  }

SORRY i am not and advanced programmer , it is just an idea that i suggest