diff --git a/DesktopEdge/Views/Screens/MainMenu.xaml.cs b/DesktopEdge/Views/Screens/MainMenu.xaml.cs index 806534c3..4c75c3f2 100644 --- a/DesktopEdge/Views/Screens/MainMenu.xaml.cs +++ b/DesktopEdge/Views/Screens/MainMenu.xaml.cs @@ -536,6 +536,7 @@ namespace ZitiDesktopEdge { } } + /// /// Show the Edit Modal and blur the background /// diff --git a/ZitiDesktopEdge.Client/DataStructures/DataStructures.cs b/ZitiDesktopEdge.Client/DataStructures/DataStructures.cs index 0bcb05f0..85152ce3 100644 --- a/ZitiDesktopEdge.Client/DataStructures/DataStructures.cs +++ b/ZitiDesktopEdge.Client/DataStructures/DataStructures.cs @@ -530,4 +530,5 @@ namespace ZitiDesktopEdge.DataStructures { public NotificationFrequencyPayload Payload { get; set; } } + } diff --git a/ZitiDesktopEdge.Client/ServiceClient/DataClient.cs b/ZitiDesktopEdge.Client/ServiceClient/DataClient.cs index d5bbac14..378344c9 100644 --- a/ZitiDesktopEdge.Client/ServiceClient/DataClient.cs +++ b/ZitiDesktopEdge.Client/ServiceClient/DataClient.cs @@ -449,6 +449,7 @@ namespace ZitiDesktopEdge.ServiceClient { return resp; } + async public Task debugAsync() { try { await sendAsync(new ServiceFunction() { Function = "Debug" }); diff --git a/release-notes.md b/release-notes.md index acd3bb5d..51de24f1 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,3 +1,18 @@ +# Release 1.10.2 + +## What's New +* none + +## Other changes: +* [#430](https://github.com/openziti/desktop-edge-win/issues/430) Snooze service timeout Notification. + - Send notification if WDE receives the service updates with timeout that is less than 5 minutes + +## Bugs fixed: +* none + +## Dependency Updates +* none + # Release 1.10.1 ## What's New diff --git a/service/ziti-tunnel/dto/dtos.go b/service/ziti-tunnel/dto/dtos.go index 657a5a47..b6052bc3 100644 --- a/service/ziti-tunnel/dto/dtos.go +++ b/service/ziti-tunnel/dto/dtos.go @@ -90,6 +90,7 @@ type Identity struct { MfaMaxTimeoutRem int32 MfaLastUpdatedTime time.Time ServiceUpdatedTime time.Time + Notified bool } type Metrics struct { diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 7b76aa54..32338069 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -127,6 +127,7 @@ func SubMain(ops chan string, changes chan<- svc.Status, winEvents <-chan Window } } } + broadcastNotification(true) case <-shutdownDelay: log.Tracef("Exiting windows power events loop") return @@ -1137,6 +1138,11 @@ func handleBulkServiceChange(sc cziti.BulkServiceChange) { } rts.BroadcastEvent(m) + id := rts.Find(sc.Fingerprint) + if id != nil && !id.Notified { + broadcastNotification(true) + } + } func addUnit(count int, unit string) (result string) { @@ -1190,17 +1196,27 @@ func handleEvents(isInitialized chan struct{}) { // notification message case <-notificationFrequency.C: - broadcastNotification() + broadcastNotification(false) } } } -func broadcastNotification() { +func broadcastNotification(adhoc bool) { + changedNotifiedStatus := false cleanNotifications := make([]cziti.NotificationMessage, 0) for _, id := range rts.ids { + if id.CId == nil || !id.CId.MfaRefreshNeeded() { continue } + + if !id.Notified { + rts.SetNotified(id.FingerPrint, true) + changedNotifiedStatus = true + } else if id.Notified && adhoc { + continue + } + notificationMessage := "" var notificationMinTimeout int32 = 0 @@ -1235,8 +1251,13 @@ func broadcastNotification() { } } + if changedNotifiedStatus && adhoc { + ResetFrequency(rts.state.NotificationFrequency) + } + if len(cleanNotifications) > 0 { log.Debugf("Sending notification message to UI %v", cleanNotifications) + rts.BroadcastEvent(cziti.TunnelNotificationEvent{ Op: "notification", Notification: cleanNotifications, @@ -1348,8 +1369,9 @@ func authMfa(out *json.Encoder, fingerprint string, code string) { if result == nil { // respond with auth success message immediately respond(out, dto.Response{Message: "AuthMFA complete", Code: SUCCESS, Error: "", Payload: fingerprint}) - + rts.SetNotified(fingerprint, false) id.CId.UpdateMFATime() + broadcastNotification(true) } else { respondWithError(out, fmt.Sprintf("AuthMFA failed. the supplied code [%s] was not valid: %s", code, result), 1, result) } @@ -1400,3 +1422,4 @@ func updateNotificationFrequency(out *json.Encoder, notificationFreq int) { respond(out, dto.Response{Message: "Notification frequency is set", Code: SUCCESS, Error: "", Payload: ""}) } + diff --git a/service/ziti-tunnel/service/state.go b/service/ziti-tunnel/service/state.go index efddaa95..409d7770 100644 --- a/service/ziti-tunnel/service/state.go +++ b/service/ziti-tunnel/service/state.go @@ -555,6 +555,14 @@ func (t *RuntimeState) UpdateMfa(fingerprint string, mfaEnabled bool, mfaNeeded } } +func (t *RuntimeState) SetNotified(fingerprint string, notified bool) { + id := t.Find(fingerprint) + + if id != nil { + id.Notified = notified + } +} + func (t *RuntimeState) UpdateNotificationFrequency(notificationFreq int) error { log.Infof("setting notification frequency : %d", notificationFreq) @@ -569,3 +577,4 @@ func (t *RuntimeState) UpdateNotificationFrequency(notificationFreq int) error { return nil } +