{"action":"created","issue":{"url":"https://api.github.com/repos/redux-offline/redux-offline/issues/237","repository_url":"https://api.github.com/repos/redux-offline/redux-offline","labels_url":"https://api.github.com/repos/redux-offline/redux-offline/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/redux-offline/redux-offline/issues/237/comments","events_url":"https://api.github.com/repos/redux-offline/redux-offline/issues/237/events","html_url":"https://github.com/redux-offline/redux-offline/issues/237","id":332574881,"node_id":"MDU6SXNzdWUzMzI1NzQ4ODE=","number":237,"title":"How to differentiate a commit action from outbox vs normal commit?","user":{"login":"ethantran","id":3276358,"node_id":"MDQ6VXNlcjMyNzYzNTg=","avatar_url":"https://avatars2.githubusercontent.com/u/3276358?v=4","gravatar_id":"","url":"https://api.github.com/users/ethantran","html_url":"https://github.com/ethantran","followers_url":"https://api.github.com/users/ethantran/followers","following_url":"https://api.github.com/users/ethantran/following{/other_user}","gists_url":"https://api.github.com/users/ethantran/gists{/gist_id}","starred_url":"https://api.github.com/users/ethantran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethantran/subscriptions","organizations_url":"https://api.github.com/users/ethantran/orgs","repos_url":"https://api.github.com/users/ethantran/repos","events_url":"https://api.github.com/users/ethantran/events{/privacy}","received_events_url":"https://api.github.com/users/ethantran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-14T21:43:03Z","updated_at":"2018-06-16T14:57:07Z","closed_at":null,"author_association":"NONE","body":"I make a SELL_REQUEST action with SELL_SUCCESS as the commit and SELL_FAIL as the rollback. If the network is online, the SELL_SUCCESS commit happens as normal and I show an alert(\"success\"). However, I don't want this alert to show up if the SELL_SUCCESS commit happens from an \"offline to online\" scenario. There could be a bunch of outbox SELL_REQUESTS when a user has airplane mode on. When they turn airplane mode off and the SELL_REQUESTS become SELL_SUCCESS, a bunch of alerts will fire.\r\n\r\nPerhaps I am not handling the UX correctly for an offline first experience. When the network is online, I do the usual loading indicator and success alert flow. But that approach doesn't seem to work with this scenario. I can't show pending state because it will be stuck there since redux offline does not return anything after a SELL_REQUEST when network is offline. So I don't use that flow by checking if the network is offline. When the network is offline, I just update the UI as if the SELL_SUCCESS happened. But I don't know how to prevent alerts from popping up when outbox makes SELL_REQUESTS later on. The alerts are done in componentDidUpdate with an equality check."},"comment":{"url":"https://api.github.com/repos/redux-offline/redux-offline/issues/comments/397817661","html_url":"https://github.com/redux-offline/redux-offline/issues/237#issuecomment-397817661","issue_url":"https://api.github.com/repos/redux-offline/redux-offline/issues/237","id":397817661,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzgxNzY2MQ==","user":{"login":"sorodrigo","id":12124839,"node_id":"MDQ6VXNlcjEyMTI0ODM5","avatar_url":"https://avatars0.githubusercontent.com/u/12124839?v=4","gravatar_id":"","url":"https://api.github.com/users/sorodrigo","html_url":"https://github.com/sorodrigo","followers_url":"https://api.github.com/users/sorodrigo/followers","following_url":"https://api.github.com/users/sorodrigo/following{/other_user}","gists_url":"https://api.github.com/users/sorodrigo/gists{/gist_id}","starred_url":"https://api.github.com/users/sorodrigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorodrigo/subscriptions","organizations_url":"https://api.github.com/users/sorodrigo/orgs","repos_url":"https://api.github.com/users/sorodrigo/repos","events_url":"https://api.github.com/users/sorodrigo/events{/privacy}","received_events_url":"https://api.github.com/users/sorodrigo/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T14:57:07Z","updated_at":"2018-06-16T14:57:07Z","author_association":"MEMBER","body":"I will try to push a new version this week. The context param may help you achieve this."}}
{"actor":{"display_login":"sorodrigo"}}