{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/2898","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/2898/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/2898/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/2898/events","html_url":"https://github.com/sequelize/sequelize/issues/2898","id":54007941,"number":2898,"title":"Associations set on a POST request seem to not be active on next GET request","user":{"login":"MarkTraceur","id":388046,"avatar_url":"https://avatars.githubusercontent.com/u/388046?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkTraceur","html_url":"https://github.com/MarkTraceur","followers_url":"https://api.github.com/users/MarkTraceur/followers","following_url":"https://api.github.com/users/MarkTraceur/following{/other_user}","gists_url":"https://api.github.com/users/MarkTraceur/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkTraceur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkTraceur/subscriptions","organizations_url":"https://api.github.com/users/MarkTraceur/orgs","repos_url":"https://api.github.com/users/MarkTraceur/repos","events_url":"https://api.github.com/users/MarkTraceur/events{/privacy}","received_events_url":"https://api.github.com/users/MarkTraceur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-11T22:36:38Z","updated_at":"2015-01-12T13:22:16Z","closed_at":null,"body":"I have a system that does this:\r\n\r\n* POST to create a new object in the database and associate that object with several others that already exist\r\n* Return a JSON object with an href to the new object (not its actual body)\r\n* GET to get a list of objects of the same type, because we just created one and it's wise to update the list to see the new one - the server does a findAll with a proper include array to include the associated objects and returns the results\r\n\r\nExpected result: GET request should have a list of objects including the new object, which should also include the new associations\r\n\r\nActual: The new object exists, but has no associations.\r\n\r\nI thought this might be a race condition, but if that's the case, the association promises that I use in the POST request shouldn't have fired yet. I tried looking at just the associations, and for some reason request.getSong() works fine and gets the associated song, but request.Song doesn't (despite include: { model: models.Song} in the request.findAll call).\r\n\r\nAdvice, or thoughts, or a bugfix...I don't really care which, but I'd like this to start working! :)"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/69568362","html_url":"https://github.com/sequelize/sequelize/issues/2898#issuecomment-69568362","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/2898","id":69568362,"user":{"login":"MarkTraceur","id":388046,"avatar_url":"https://avatars.githubusercontent.com/u/388046?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkTraceur","html_url":"https://github.com/MarkTraceur","followers_url":"https://api.github.com/users/MarkTraceur/followers","following_url":"https://api.github.com/users/MarkTraceur/following{/other_user}","gists_url":"https://api.github.com/users/MarkTraceur/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkTraceur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkTraceur/subscriptions","organizations_url":"https://api.github.com/users/MarkTraceur/orgs","repos_url":"https://api.github.com/users/MarkTraceur/repos","events_url":"https://api.github.com/users/MarkTraceur/events{/privacy}","received_events_url":"https://api.github.com/users/MarkTraceur/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T13:22:16Z","updated_at":"2015-01-12T13:22:16Z","body":"As confirmed on IRC, I'm an asshole.\r\n\r\nI needed to wait for my Angular save() function to callback before trying to update the list. OF COURSE.\r\n\r\nThanks so much for the debugging help, @mickhansen"}}