# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ### Added -->
<!-- ### Changed -->
<!-- ### Deprecated -->
<!-- ### Removed -->
<!-- ### Fixed -->
<!-- ### Security -->
<!-- ### Documentation -->
<!-- ### Internal -->

## [Unreleased]

---

## [1.6.2] - 2025-02-19

### Fixed

 -  grpc.firmware_update: handle null metadata in upgrade requests
 -  grpc.firmware_update: log upgrade request decoding errors instead of returning gRPC error status

---

## [1.6.1] - 2024-12-13

### Fixed

 -  grpc.config: load default gRPC configs if unspecified

### Internal

 -  nix.docker: add `edgeConfig` parameter to define config file in docker image

---

## [1.6.0] - 2024-12-04

### Added

 -  mqtt.config: add MQTT `clean_start` option in configuration file

### Internal

 -  cargo: update `fundamentum-sdk-mqtt` library
     -  mqtt.backoff: Replacing the `backoff` library by the better maintained `backon`
 -  ci.flake: build package into static binary

---

## [1.5.0] - 2024-11-26

### Added

 -  grpc: expose *firmware update* service v1 (`subscribe` and `update_status` methods) from `edge-proto`
 -  grpc.firmware_update.config: add firmware update `batch_timeout_ms` and `max_batch_size` options in configuration file
 -  grpc.telemetry: implement `PublishOne` endpoint for *telemetry* service

### Changed

 -  grpc.config: load default gRPC services configs if unspecified

### Documentation

 -  changelog: v1.5.0

### Internal

 -  cargo: add `itertools` library to dependencies
 -  cargo: update `fundamentum-sdk-mqtt`, `fundamentum-edge-proto` and `fundamentum-edge-pfwd` libraries
 -  refactor: use newer rust file path style
 -  ci.flake: fix overlay field not being set properly
 
---

## [1.4.0] - 2024-10-24

### Changed

 -  grpc.actions: improve error handling and logging
 -  logging: log with local datetime

### Fixed

 -  grpc.actions: terminate async task when gRPC client disconnects

### Documentation

 -  changelog: v1.4.0

### Internal

 -  cargo: add `tokio-utils` library to dependencies
 -  cargo: add `chrono` library to dependencies
 -  cargo: strip binary in release

---

## [1.3.0] - 2024-09-13

### Added

 -  config.mqtt: add MQTT `keep_alive_sec` and `session_expiry_interval_sec` option in configuration file

### Documentation

 -  changelog: v1.3.0

### Fixed

 -  mqtt: Fixed issue where MQTT messages were not received after reconnecting following a connection loss

### Internal

 -  cargo: update `fundamentum-sdk-mqtt` and `fundamentum-edge-pfwd` libraries
 -  cargo: remove `fundamentum-iot-mqtt-proto` library from dependencies
 -  nix.docker: move `fundamentum-edge` binary to docker `entrypoint`
 -  mqtt: code refactoring

---

## [1.2.0] - 2024-08-02

### Added

 -  pfwd: add port forwarding service + cli options
 -  grpc: expose *actions* service v1 (`subscribe` and `update_status` methods) from `edge-proto`
 -  grpc: add logging in floating tasks

### Documentation

 -  changelog: v1.1.0
 -  readme: fix telemetry publish command in examples

### Fixed

 -  grpc.configuration: use logging where error could not be propagated 

### Internal

 -  cargo: add `fundamentum-edge-pfwd` library to dependencies
 -  cargo: add `fundamentum-iot-mqtt-proto` library to dependencies
 -  cargo: add `displaydoc` library to dependencies
 -  cargo: update `fundamentum-edge-proto`, `fundamentum-sdk-mqtt` and `fundamentum-edge-pfwd` libraries
 -  ci.flake: add Windows cross-build Nix package

---

## [1.1.0] - 2024-05-09

### Added

 -  grpc: expose *states* service v1 (`publish_json` method) from `edge-proto`

### Changed

 -  grpc: validate serial number when provisioning device (`provision` method)

### Documentation

 -  readme: add states usage examples to readme
 -  readme: improve overall documentation
 -  readme: document releases + link to changelog
 -  readme: add badges
 -  provisioning-procedure: initial
 -  changelog: initial + v1.0.0 + unreleased

### Internal

 -  ci.flake: use Nix for cross-compile the application and/or create a Docker 
    image of the application
 -  cargo: update `fundamentum-sdk-mqtt` and `fundamentum-edge-proto` libraries
 -  cargo: add `prost-wkt-types` library to dependencies

---

## [1.0.0] - 2024-04-04

### Added

 -  grpc: serve over either *tcp* or *uds*
 -  grpc: expose *provisioning* service v1 (`provision` method) from `edge-proto`
 -  grpc: expose *telemetry* service v1 (`publish` method) from `edge-proto`
 -  grpc: expose *configuration* service v1 (`get` and `update_stream` methods)
    from `edge-proto`
 -  grpc: activate *reflection* support via `tonic_reflection` & `edge-proto`
 -  core: support for graceful shutdown
 -  core: initial top level *app core* implementation whose role is to run /
    manage all other core services
 -  core: initial *grpc* service implementation via `tonic`
 -  core: initial *provisioning* service implementation via `sdk-http`
 -  core: initial *telemetry* service implementation via `sdk-mqtt`
 -  core: initial *configuration* service implementation via `sdk-mqtt`
 -  core: initial *heartbeat* service implementation via `sdk-mqtt` and
    `uptime_lib`
 -  core: initial *mqtt listener* service implementation via `sdk-mqtt`
 -  core: placeholder *port forwarding* service implementation via `sdk-mqtt`
 -  state: initial `provisioning.json` *state file* (v0) via `serde` &
    `serde_json`
 -  state: initial `device_config.json` *state file* (v0) via `serde` &
    `serde_json`
 -  config: initial `config.toml` *config file* support via `serde` &
    `toml`
 -  error: initial setup via `thiserror`
 -  logging: initial setup via `tracing`
 -  bin: initial `fundamentum-edge` daemon *cli* application via `clap`

### Documentation

 -  doc: initial cargo package doc
 -  doc: initial readme via `cargo-readme`
 -  doc: initial license
 -  doc: initial development setup procedure

### Internal

 -  ci: initial:
     -  manual crates.io publish trigger on version tag
     -  build and check step reusing flake and justfile
     -  optimize flake instanciation via bitbucket cache
     -  optimize cargo build via bitbucket cache workaround
 -  flake: initial nix flake developer environment
 -  justfile: initial
 -  cargo: minimal precommit git hook that runs `cargo fmt` via `cargo-husky`
 -  cargo: initial `fundamentum-` dependencies:
     -  `edge-proto` at v1.0.1 with server boilerplate for the *provisioning*,
        *telemetry* and *configuration* services. Also brings  *reflection* file
        descriptor set for those services.
     -  `sdk-mqtt` at v0.4.0 now using *MQTT v5* and defaulting to *native tls* via
        `openssl`
     -  `sdk-api` at v0.2.1 now with `api/v3` support
 -  cargo: initial project
 -  gitignore: initial
 -  vscode: initial common settings

---

[Unreleased]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/master%0Dv1.6.2
[1.6.2]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.6.2%0Dv1.6.1
[1.6.1]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.6.1%0Dv1.6.0
[1.6.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.6.0%0Dv1.5.0
[1.5.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.5.0%0Dv1.4.0
[1.4.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.4.0%0Dv1.3.0
[1.3.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.3.0%0Dv1.2.0
[1.2.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.2.0%0Dv1.1.0
[1.1.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/branches/compare/v1.1.0%0Dv1.0.0
[1.0.0]: https://bitbucket.org/amotus/fundamentum-edge-daemon/commits/tag/v1.0.0