Protocol support for batching?

Open
#1,002 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start at the AnalyticsBrowser.load entry point and trace how the Segment.io integration handles the protocol and deliveryStrategy batching options. Reproduce the configuration with batching enabled and verify that batched requests honor protocol: "http" rather than using HTTPS.

Written by the indexing model from the issue text.

Description

bug

Hello! We have a backend that's processing batches of events. While I was doing some debugging locally, I noticed that if the delivery strategy is set to batching, specifying the protocol as 'http' doesn't have any effect, and the calls are still sent through HTTPS.
Once I disabled batching, specifying the protocol as 'http' started working.

AnalyticsBrowser.load(
      {
        writeKey: 'VALUE_NOT_REQUIRED',
        cdnURL: baseUrl,
        cdnSettings: { integrations: {['Segment.io']: {}}},
      },
      {
        integrations: {
          'Segment.io': {
            apiHost: baseUrl,
            protocol: "http",
            deliveryStrategy: {
              strategy: "batching",
              config: {
                size: 10,
                timeout: 5000
              }
            },
            addBundledMetadata: false
          }
        }
      }
    );

Is this by design or can something be done here to allow batches to go through http?

Dominant language
TypeScript
Stars
477
Forks
160
Avg merge
6h 19m
Merged PRs (30d)
4

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.

More from segmentio/analytics-next

All issues in segmentio/analytics-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.