BasedHardware / omi

AI wearables
https://omi.me
MIT License
3.29k stars 389 forks source link

App retry system on memory creation if fails #517

Closed josancamon19 closed 1 month ago

josancamon19 commented 1 month ago

Is your feature request related to a problem? Please describe. If the app fails when creating a memory:

debugPrint('processTranscriptContent');
  if (transcript.isEmpty && photos.isEmpty) return null;
  // TODO: handle connection errors, or anything
  // store locally first, with a flag of send to server once the app connects again to the internet.
  CreateMemoryResponse? result = await createMemoryServer(
    startedAt: startedAt ?? DateTime.now(),
    finishedAt: finishedAt ?? DateTime.now(),
    transcriptSegments: transcriptSegments,
    geolocation: geolocation,
    photos: photos,
  );
  if (result == null) return null;
  ServerMemory? memory = result.memory;
  if (memory == null) return null;

  // EVENTS
  webhookOnMemoryCreatedCall(memory).then((s) {
    if (s.isNotEmpty) createNotification(title: 'Developer: On Memory Created', body: s, notificationId: 11);
  });

We should have a local list of memories failed to create, should be stored as discarded temporarilly, with some uuid4 and some default data, and when the user opens the app again we should attempt to synchornize with the server by calling create memory for each one, before reading the list of memories available.

josancamon19 commented 1 month ago

Fixed, it's released and on main branch