mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-26 18:12:13 +08:00
fix(activity): "Long Polling" => "Delta Streaming" because we don't really poll.
This commit is contained in:
parent
eec7c829ce
commit
3c9db9bd85
4 changed files with 7 additions and 7 deletions
|
@ -27,7 +27,7 @@ The Developer Panel provides three views which you can click to activate:
|
|||
|
||||
- `Tasks`: This view allows you to inspect the {TaskQueue} and see the what tasks are pending and complete. Click a task to see its JSON representation and inspect it's values, including the last error it encountered.
|
||||
|
||||
- `Long Polling`: This view allows you to see the streaming updates from the Nylas API that the app has received. You can click individual updates to see the exact JSON that was consumed by the app, and search in the lower left for updates pertaining to an object ID or type.
|
||||
- `Delta Streaming`: This view allows you to see the streaming updates from the Nylas API that the app has received. You can click individual updates to see the exact JSON that was consumed by the app, and search in the lower left for updates pertaining to an object ID or type.
|
||||
|
||||
- `Requests`: This view shows the requests the app has made to the Nylas API in `curl`-equivalent form. (The app does not actually make `curl` requests). You can click "Copy" to copy a `curl` command to the clipboard, or "Run" to execute it in a new Terminal window.
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class NylasLongConnection
|
|||
|
||||
@withCursor (cursor) =>
|
||||
return if @state is NylasLongConnection.State.Ended
|
||||
console.log("Long Polling Connection: Starting for account #{@_accountId}, token #{token}, with cursor #{cursor}")
|
||||
console.log("Delta Connection: Starting for account #{@_accountId}, token #{token}, with cursor #{cursor}")
|
||||
options = url.parse("#{@_api.APIRoot}/delta/streaming?cursor=#{cursor}&exclude_folders=false")
|
||||
options.auth = "#{token}:"
|
||||
|
||||
|
@ -113,7 +113,7 @@ class NylasLongConnection
|
|||
if res.statusCode isnt 200
|
||||
res.on 'data', (chunk) =>
|
||||
if chunk.toString().indexOf('Invalid cursor') > 0
|
||||
console.log('Long Polling Connection: Cursor is invalid. Need to blow away local cache.')
|
||||
console.log('Delta Connection: Cursor is invalid. Need to blow away local cache.')
|
||||
# TODO THIS!
|
||||
else
|
||||
@retry()
|
||||
|
@ -158,7 +158,7 @@ class NylasLongConnection
|
|||
, startDelay
|
||||
|
||||
end: ->
|
||||
console.log("Long Polling Connection: Closed.")
|
||||
console.log("Delta Connection: Closed.")
|
||||
@setState(NylasLongConnection.State.Ended)
|
||||
@cleanup()
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ describe "NylasSyncWorker", ->
|
|||
expect(@worker.state().contacts.busy).toEqual(false)
|
||||
|
||||
describe "start", ->
|
||||
it "should open the long polling connection", ->
|
||||
it "should open the delta connection", ->
|
||||
spyOn(@connection, 'start')
|
||||
@worker.start()
|
||||
advanceClock()
|
||||
|
@ -312,7 +312,7 @@ describe "NylasSyncWorker", ->
|
|||
expect(@worker.state().threads.errorRequestRange).toEqual(null)
|
||||
|
||||
describe "cleanup", ->
|
||||
it "should termiate the long polling connection", ->
|
||||
it "should termiate the delta connection", ->
|
||||
spyOn(@connection, 'end')
|
||||
@worker.cleanup()
|
||||
expect(@connection.end).toHaveBeenCalled()
|
||||
|
|
|
@ -44,7 +44,7 @@ class DeveloperBar extends React.Component
|
|||
{ _.map @state.longPollState, (val, key) =>
|
||||
<div title={"Account ID #{key} - State: #{val}"} key={key} className={"activity-status-bubble state-" + val}></div>
|
||||
}
|
||||
<span>Long Polling</span>
|
||||
<span>Delta Streaming</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="btn-container pull-left">
|
||||
|
|
Loading…
Reference in a new issue