From 6ca15ffe8beafe63347671b8a332ac9304f5eb59 Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Thu, 3 Oct 2024 16:49:48 +0530 Subject: [PATCH] fix: generate tile_id in POST /dashboards 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