From c912ff52a8872a2360c76ae79f86987e45062c4b Mon Sep 17 00:00:00 2001 From: Nikhil Sinha <131262146+nikhilsinhaparseable@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:05:51 +0530 Subject: [PATCH] fix: generate tile_id in POST /dashboards (#952) issue: tile_id gets generated by hash of timestamp in microseconds for import dashboard (with multiple tiles) scenarios, more than one tile gets same tile_id fix is to add random string and timestamp to calculate hash for generating tile_id --- server/src/handlers/http/users/dashboards.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/src/handlers/http/users/dashboards.rs b/server/src/handlers/http/users/dashboards.rs index 81945914e..354689834 100644 --- a/server/src/handlers/http/users/dashboards.rs +++ b/server/src/handlers/http/users/dashboards.rs @@ -25,6 +25,7 @@ use crate::{ }; use actix_web::{http::header::ContentType, web, HttpRequest, HttpResponse, Responder}; use bytes::Bytes; +use rand::distributions::DistString; use chrono::Utc; use http::StatusCode; @@ -61,7 +62,14 @@ pub async fn post(req: HttpRequest, body: Bytes) -> Result