logdna / logdna/logdna-browser

Handle unstable net connection ingestion

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23
Forks
10
PR merge metrics
No merged PRs in 30d

Description

### Library version

Version: 2.2.0

### What's happening:

We use `logdna-browser` for a capacitor/ionic app but have noticed that when the net goes offline and a log is sent, fetch throws an error which results in the buffer-manager in this library not to send log batches anymore [as seen here](https://github.com/logdna/logdna-browser/blob/20bce037d0be86fd5c154c74601c2dddf42b36eb/src/buffer-manager.ts#L73).

### What should happen:

This library should handle network disconnects and not shut down, which would be the case for web apps on browser and mobile.
Or at least give a hook to the developer so that they can recover by re-initializing.

### Reproduction steps:

In a react/vue/angular sample app, add this library and some logs and `npm start`. Navigate to the app in the browser and either close the connection through the inspection window or just your net connection. The library stops logging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/buffer-manager.ts around line 73, where the issue reports that a failed fetch stops later log batches from being sent. Reproduce the behavior in a React, Vue, or Angular sample app with npm start while disabling the network. Done means logging recovers after the connection returns, or the library exposes a documented recovery hook.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.