Fix node id renewal

This commit is contained in:
Maurus Decimus
2026-04-29 11:38:13 +02:00
parent 1abcc9a942
commit 450a76d56d
4 changed files with 11 additions and 12 deletions

View File

@@ -13,6 +13,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
## Fixed
- Directory: Invalidate caches when group memberships change on an external directory.
- Log viewer: All events show as `INFO`.
- Node id renewal.
## [0.16.2] - 2026-04-28

View File

@@ -458,7 +458,7 @@ impl Server {
account: directory::Account,
remote_ip: IpAddr,
) -> trc::Result<AccessToken> {
let account = self.synchronize_account(account).await?;
let account = Box::pin(self.synchronize_account(account)).await?;
self.access_token_from_account(account.id, account.account)
.await
.and_then(|token| AccessToken::new(token, remote_ip))

View File

@@ -115,11 +115,11 @@ impl Server {
};
match directory.recipient(address.as_ref()).await? {
Recipient::Account(account) => {
self.synchronize_account(account).await?;
Box::pin(self.synchronize_account(account)).await?;
return Ok(RcptResolution::Accept);
}
Recipient::Group(group) => {
self.synchronize_group(group).await?;
Box::pin(self.synchronize_group(group)).await?;
return Ok(RcptResolution::Accept);
}
Recipient::Invalid => {}

View File

@@ -238,15 +238,13 @@ impl RegistryStore {
pub async fn refresh_node_id_lease(&self) -> trc::Result<()> {
let mut batch = BatchBuilder::new();
batch
.assert_value(ValueClass::NodeId(self.0.node_id), ())
.set(
ValueClass::NodeId(self.0.node_id),
KeySerializer::new(self.0.env_hostname.len() + U64_LEN)
.write(now())
.write(&self.0.env_hostname)
.finalize(),
);
batch.set(
ValueClass::NodeId(self.0.node_id),
KeySerializer::new(self.0.env_hostname.len() + U64_LEN)
.write(now())
.write(&self.0.env_hostname)
.finalize(),
);
self.0
.store
.write(batch.build_all())