Prioritize local over span keys when serializing webhook payloads (#1250)

This commit is contained in:
mdecimus
2025-03-02 17:04:33 +01:00
parent d1f18d5fe8
commit 6522073957
2 changed files with 9 additions and 6 deletions

View File

@@ -7,15 +7,15 @@
use std::{collections::hash_map::Entry, fmt, str::FromStr};
use serde::{
Deserializer, Serializer,
de::{self, IgnoredAny, Visitor},
ser::SerializeMap,
Deserializer, Serializer,
};
use store::U64_LEN;
use crate::{
Permission, Principal, ROLE_ADMIN, Type,
backend::internal::{PrincipalField, PrincipalUpdate, PrincipalValue},
Permission, Principal, Type, ROLE_ADMIN,
};
impl Principal {
@@ -369,7 +369,10 @@ impl Principal {
pub fn update_external(&mut self, mut external: Principal) -> Vec<PrincipalUpdate> {
let mut updates = Vec::new();
if let Some(name) = external.take_str(PrincipalField::Description) {
if let Some(name) = external
.take_str(PrincipalField::Description)
.filter(|s| !s.is_empty())
{
if self.get_str(PrincipalField::Description) != Some(name.as_str()) {
updates.push(PrincipalUpdate::set(
PrincipalField::Description,