Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Remove the NEW_DATA broadcast intent when we pull data from the s… #56

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="cordova-plugin-em-serversync"
version="1.3.2">
version="1.3.3">

<name>ServerSync</name>
<description>Push and pull local data to the server</description>
Expand Down
7 changes: 0 additions & 7 deletions src/android/ServerSyncAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@ public void onPerformSync(Account account, Bundle extras, String authority,
new StatsEvent(cachedContext, R.string.pull_duration));
}

// We are sending this only locally, so we don't care about the URI and so on.
Intent localIntent = new Intent("edu.berkeley.eecs.emission.sync.NEW_DATA");
Bundle b = new Bundle();
b.putString( "userdata", "{}" );
localIntent.putExtras(b);
Log.i(cachedContext, TAG, "Finished sync, sending local broadcast");
LocalBroadcastManager.getInstance(cachedContext).sendBroadcastSync(localIntent);
biuc.putMessage(R.string.key_usercache_client_time,
new StatsEvent(cachedContext, R.string.sync_duration, to.elapsedSecs()));
}
Expand Down
13 changes: 1 addition & 12 deletions src/ios/BEMServerSyncCommunicationHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,7 @@ +(BFTask*) pullIntoUserCache {
StatsEvent* se = [[StatsEvent alloc] initForReading:@"sync_pull_list_size" withReading:newSectionCount];
[[BuiltinUserCache database] putMessage:@"key.usercache.client_time" value:se];

if (newSectionCount > 0) {
// Note that we need to update the UI before calling the completion handler, otherwise
// when the view appears, users won't see the newly fetched data!
[[NSNotificationCenter defaultCenter] postNotificationName:BackgroundRefreshNewData
object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:@"edu.berkeley.eecs.emission.sync.NEW_DATA"
object:nil
userInfo:nil];
[task setResult:@(TRUE)];
} else {
[task setResult:@(TRUE)];
}
[task setResult:@(TRUE)];
}
StatsEvent* se = [[StatsEvent alloc] initForReading:@"pull_duration" withReading:[t elapsed_secs]];
[[BuiltinUserCache database] putMessage:@"key.usercache.client_time" value:se];
Expand Down