[client-app] only show cloud deltas in the developer bar

Summary:
This removes client-sync deltas from the developerbar delta list.

We ONLY show cloud deltas now.

The connection between client-sync is no longer a network delta stream,
it's a direct function call. It makes no sense to show its status.

This now shows a single dot representing the state of the cloud delta
stream.

Test Plan: Manually connect and disconnect local cloud API and see icon change

Reviewers: halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3977
This commit is contained in:
Evan Morikawa 2017-02-17 17:33:18 -08:00
parent d1b5cb9952
commit 12236753d5
4 changed files with 8 additions and 8 deletions

View file

@ -60,10 +60,12 @@ class DeltaProcessor {
this.activationTime = Date.now()
}
async process(rawDeltas = []) {
async process(rawDeltas = [], {source} = {}) {
try {
const deltas = await this._decorateDeltas(rawDeltas);
Actions.longPollReceivedRawDeltas(deltas);
if (source === "n1Cloud") {
Actions.longPollReceivedRawDeltas(deltas);
}
const {
modelDeltas,

View file

@ -15,7 +15,7 @@ class DeltaStreamingConnection extends NylasLongConnection {
// Update cursor when deltas received
this.onResults((deltas = []) => {
if (opts.onDeltas) opts.onDeltas(deltas);
if (opts.onDeltas) opts.onDeltas(deltas, {source: "n1Cloud"});
const last = _.last(deltas);
if (last && last.cursor) {
this._setCursor(last.cursor)

View file

@ -13,7 +13,7 @@ class DeltaStreamingInMemoryConnection {
onDeltas = (allDeltas = []) => {
const deltas = allDeltas.filter((d) => d.accountId === this._accountId);
this._onDeltas(deltas);
this._onDeltas(deltas, {source: "localSync"});
const last = deltas[deltas.length - 1]
if (last) this._setCursor(last.cursor);
}

View file

@ -48,7 +48,7 @@ class DeveloperBar extends React.Component
<div className="btn-container pull-left">
<div className="btn" onClick={ => @_onExpandSection('long-polling')}>
{@_renderDeltaStates()}
<span>Delta Streaming</span>
<span>Cloud Deltas</span>
</div>
</div>
<div className="btn-container pull-left">
@ -72,9 +72,7 @@ class DeveloperBar extends React.Component
_renderDeltaStates: =>
_.map @state.longPollStates, (deltaStatus, accountId) =>
<div className="delta-state-wrap" key={accountId} >
{ _.map deltaStatus, (val, deltaName) =>
<div title={"Account #{accountId} - #{deltaName} State: #{val}"} key={"#{accountId}-#{deltaName}"} className={"activity-status-bubble state-" + val}></div>
}
<div title={"Account #{accountId} - Cloud State: #{deltaStatus?.n1Cloud}"} key={"#{accountId}-n1Cloud"} className={"activity-status-bubble state-" + deltaStatus?.n1Cloud}></div>
</div>
_sectionContent: =>