question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PushItemsAsync bug ?

See original GitHub issue

Discussed in https://github.com/Azure/azure-mobile-apps/discussions/570

<div type='discussions-op-text'>

Originally posted by henda79 January 16, 2023 I have noticed an issue when trying to push a single table, but I’m not sure if its a bug or intended,

At the moment I have a single record in the _errors table for table A, now if I try to push table B I get an error which seems odd because the pushing of table B worked fine. It returns the error due to the previous error of table A now stored in the __errors table.

It is this code here in the PushItemsAsync method. It just gets all records from the __errors table and reports the problem.

Surely it should just get errors from the table I am trying to push ?

            List<TableOperationError> errors = new();
            PushStatus batchStatus = batch.AbortReason ?? PushStatus.Complete;
            try
            {
                errors.AddRange(await batch.LoadErrorsAsync(cancellationToken).ConfigureAwait(false));
            }
            catch (Exception ex)
            {
                batch.OtherErrors.Add(new OfflineStoreException("Failed to read errors from the local store.", ex));
            }
            SendPushFinishedEvent(batchStatus != PushStatus.Complete);

            // If the push did not complete successfully, then throw a PushFailedException.
            if (batchStatus != PushStatus.Complete || batch.HasErrors(errors))
            {
                List<TableOperationError> unhandledErrors = errors.Where(error => !error.Handled).ToList();
                Exception innerException = batch.OtherErrors.Count > 0 ? new AggregateException(batch.OtherErrors) : null;
                throw new PushFailedException(new PushCompletionResult(unhandledErrors, batchStatus), innerException);
            }
```</div>

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
adrianhallcommented, Feb 3, 2023

I’ve made two minimal changes in #581:

  1. When the store is initialized, all errors are cleared.
  2. When a sync is finished, all non-conflict errors are cleared.

This should sort out the issues that were reported. If there are more conditions when errors cause problems, let me know via a new bug and I’ll fix the situation.

0reactions
josuuribecommented, Jan 31, 2023

When i was using the SDK, I thought that methods like CancelAndDiscardItemAsync CancelAndUpdateItemAsync will also removed all relevant information, like pending queue item, errors, etc… In other side i think there should be always a way for remove all that includes all tables anda data, sthg like the final purge 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

NULL values are not updated when calling IOfflineTable. ...
Describe the bug When a field of an item is changed from any value to null, then this field is not updated on...
Read more >
How to use the Azure Mobile Apps client library for .NET
This guide shows you how to perform common scenarios using the .NET client library for Azure Mobile Apps. Use the .NET client library...
Read more >
Offline data sync for mobile apps - Azure
Offline data sync is an SDK feature of Azure Mobile Apps. Data is stored in a local store. When your app is offline,...
Read more >
'There are still pending operations for table 'todo' after a ...
I am trying to create a MAUI app with offline data sync. I am getting the above error on Android emulator when calling...
Read more >
1Password.exe - powered by Falcon Sandbox
String Context Stream UID ingdirect.com Domain/IP reference 13e0cfbe5a7c87450b38cc2b69a927ca‑600117... hasibeenpwned.com Domain/IP reference 13e0cfbe5a7c87450b38cc2b69a927ca‑600064... google.com Domain/IP reference 13e0cfbe5a7c87450b38cc2b69a927ca‑600117...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found