status-go/protocol/requests/enable_installation_and_pair.go
frank a08319f615
fix(sync)_: sync fallback notification (#5888)
* fix(sync)_: Improve EnableInstallationAndSync and add EnableInstallationV2

- Refactor EnableInstallationAndSync for better error handling and response merging
- Add new EnableInstallationV2 method returning the installation
- Update tests to check for installation in response
- Deprecate old EnableInstallation method

* chore_: remove EnableInstallationV2

* fix(sync)_: create/delete AC notification only when targetInstallationID match

- Add targetInstallationID parameter to SendPairInstallation function
- Update protobuf SyncPairInstallation struct with TargetInstallationId field
- Modify method calls across multiple test files to include new parameter
- Update pairing.proto and pairing.pb.go with new field for local pairing

* chore_: rename stubEnableInstallationAndPair

chore_: move InstallationIDProvider

chore_: revert endpoints.go

test_: check AC with resp

chore_: rename ModifiedInstallationsTargetedToThisDevice

test_: add InstallationIDProvider

chore_: revert endpoints.go

chore_: remove comment

test_: add TestNewInstallationCreatedIsNotDeleted
2024-10-07 22:05:37 +08:00

24 lines
489 B
Go

package requests
import (
"errors"
)
var ErrEnableInstallationAndPairInvalidID = errors.New("enable installation and pair: invalid installation id")
type EnableInstallationAndPair struct {
InstallationID string `json:"installationId"`
}
func (j *EnableInstallationAndPair) Validate() error {
if len(j.InstallationID) == 0 {
return ErrEnableInstallationAndPairInvalidID
}
return nil
}
func (j *EnableInstallationAndPair) GetInstallationID() string {
return j.InstallationID
}