[Bug] OTEL push method is stored as a database method

Open Beginner friendly
#31 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
backend

Research direction

Start with buildPropertiesFromGrpc() in pkg/util/parse and trace the OTEL branch alongside the HTTP and MQTT branches. Run go test -mod=mod ./pkg/util/parse and use the focused regression test to verify that an OTEL property sets PushMethod.MethodName to common.PushMethodOTEL and is initialized by the OTEL handler.

Written by the indexing model from the issue text.

Description

What happened:

buildPropertiesFromGrpc() assigns the OTEL push method constant to DBMethodName instead of PushMethod.MethodName. The generated mapper therefore does not recognize the property as an OTEL push method.

What you expected to happen:

A device property configured with an OTEL push method should produce PushMethod.MethodName == common.PushMethodOTEL and be initialized by the OTEL handler.

How to reproduce it:

  1. Build a DMI device with one property whose PushMethod.Otel is set.
  2. Pass the device to buildPropertiesFromGrpc().
  3. Inspect the resulting DeviceProperty.PushMethod.
  4. The current code leaves MethodName empty and writes otel into DBMethodName instead.

Proposed fix:

Store common.PushMethodOTEL in pushMethodName, matching the HTTP and MQTT branches. A focused regression test covers the parser output.

Validation:

go test -mod=mod ./pkg/util/parse passes with the repository API dependency on macOS.

Dominant language
Go
Stars
6
Forks
7
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.