{"action":"created","issue":{"url":"https://api.github.com/repos/node-red/node-red/issues/870","repository_url":"https://api.github.com/repos/node-red/node-red","labels_url":"https://api.github.com/repos/node-red/node-red/issues/870/labels{/name}","comments_url":"https://api.github.com/repos/node-red/node-red/issues/870/comments","events_url":"https://api.github.com/repos/node-red/node-red/issues/870/events","html_url":"https://github.com/node-red/node-red/issues/870","id":148463809,"number":870,"title":"Context not cleared on re-deploy","user":{"login":"colinl","id":38307,"avatar_url":"https://avatars.githubusercontent.com/u/38307?v=3","gravatar_id":"","url":"https://api.github.com/users/colinl","html_url":"https://github.com/colinl","followers_url":"https://api.github.com/users/colinl/followers","following_url":"https://api.github.com/users/colinl/following{/other_user}","gists_url":"https://api.github.com/users/colinl/gists{/gist_id}","starred_url":"https://api.github.com/users/colinl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinl/subscriptions","organizations_url":"https://api.github.com/users/colinl/orgs","repos_url":"https://api.github.com/users/colinl/repos","events_url":"https://api.github.com/users/colinl/events{/privacy}","received_events_url":"https://api.github.com/users/colinl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-14T19:49:16Z","updated_at":"2016-04-16T09:06:32Z","closed_at":null,"body":"The context is not cleared during a full re-deploy.\r\nTo replicate put the following code in a function block\r\n\r\nlast_time = context.get('last_time');\r\nnode.log(\"last time: \" + last_time);\r\ncontext.set(last_time', new Date());\r\n\r\nRun the flow and then perform a full re-deploy.  The first time through after re-deploy, last_time should be undefined, but in fact it gets the value from the context.set before the re-deploy.\r\n\r\nRunning on Pi (Jessie)\r\nNode-RED version: v0.13.3\r\nNode.js  version: v0.10.29\r\nLinux 4.1.19-v7+ arm LE\r\n"},"comment":{"url":"https://api.github.com/repos/node-red/node-red/issues/comments/210778205","html_url":"https://github.com/node-red/node-red/issues/870#issuecomment-210778205","issue_url":"https://api.github.com/repos/node-red/node-red/issues/870","id":210778205,"user":{"login":"dceejay","id":5375409,"avatar_url":"https://avatars.githubusercontent.com/u/5375409?v=3","gravatar_id":"","url":"https://api.github.com/users/dceejay","html_url":"https://github.com/dceejay","followers_url":"https://api.github.com/users/dceejay/followers","following_url":"https://api.github.com/users/dceejay/following{/other_user}","gists_url":"https://api.github.com/users/dceejay/gists{/gist_id}","starred_url":"https://api.github.com/users/dceejay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dceejay/subscriptions","organizations_url":"https://api.github.com/users/dceejay/orgs","repos_url":"https://api.github.com/users/dceejay/repos","events_url":"https://api.github.com/users/dceejay/events{/privacy}","received_events_url":"https://api.github.com/users/dceejay/received_events","type":"User","site_admin":false},"created_at":"2016-04-16T09:06:32Z","updated_at":"2016-04-16T09:06:32Z","body":"In the user defined node it will depend where/when they are attaching themselves to context - (and indeed depending how it's being done it may or may not be the same context as functions use). If it's in the general setup but before the actual node instance definition then it will be  global across that node definition (and so not cleared as that is only set up at start time) - If inside the actual node instance then again it depends which context they have attached to. It's up to the node author to do the right thing."}}