heardock_core 0.1.0
heardock_core: ^0.1.0 copied to clipboard
Headless Heardock client for Flutter: context capture, idempotent submission, and an offline queue with no UI attached. Bring your own feedback form.
0.1.0 #
- First headless release:
configure,identify,setContext,captureContext,submit,flushQueue,pendingCount. - Extracted from
heardock_flutterso custom-designed apps can keep their own form while reusing context capture, idempotent submission, and the offline queue. flushQueue()now returns aQueueFlushReport(sent/dropped/pending) instead ofvoid.HeardockStrings.errorForexposes the localized error mapping that used to be private to the sheet.- Removed UI-only email strings (
emailLabel,emailHelper,emailInvalid,replyToTemplate) now that the form no longer asks for an email. - Device token (install × project) plus
threads()/thread(id)/markSeen(id)for reading team replies. threads()now prepends notes still in the offline queue asFeedbackThread.pendingentries (newest first), andthread(id)resolves those local ids without a request. Pending notes stay visible when retryable history failures (offline / 5xx) occur; config errors still surface.- Removed the "Goes straight to the … team." subtitle
(
subtitle/subtitleTemplate); the bundled form no longer renders it. - New copy for the redesigned thread page:
noRepliesBody,loadErrorBody, andloadingReplies(used as the skeleton's accessibility label). - List and thread reads are cached in memory for 5 minutes (
cacheTtl), so reopening the centre or a thread does not hit the network.threads(refresh:)/thread(id, refresh:)force a read,cachedThread(id)exposes the cached copy, andclearCache()drops everything. Successful submits, queue flushes, deletes, and explicit list refreshes invalidate the right entries. - New
deleteThread(id): removes the note from the owning device (DELETE /v1/threads/:id). The API is a soft delete — the server keeps the note and its team replies for the inbox, and only device-facing reads hide it. Queued notes are removed from the offline queue instead. New copy:deleteFeedback,deleteTitle,deleteBody,deleteAction,deleteError,cancel. - On-device snapshot: after a successful list/thread read the SDK stores a
read-only copy in
SharedPreferences, so a cold start paints the last known history before the network answers. Bound to the device token + public key, expires afterpersistTtl(7 days), capped at 50 threads / 512 KB. Opt out withHeardockConfig(persistHistory: false); wipe withclearPersistedCache().deleteThreadupdates the snapshot and keeps a tombstone, so a list response that still contains the note (replica lag) cannot make it reappear. - New
revalidatedThread(id)andrevalidateAfter(30s): the detail-page loader returns the cached copy when it is younger than the window, otherwise fetches once and shares that request with concurrent callers (single-flight). A failed revalidation returns the cached copy instead of throwing. - No widgets are imported;
heardock_flutterdepends on this package and re-exports its public API.