Skip to content

Commit

Permalink
Merge branch 'interuss:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishiballal authored Apr 8, 2024
2 parents 33367bd + 8e3f849 commit 79a5b7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/scd/subscriptions_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scd

import (
"context"
"time"

"github.com/golang/geo/s2"
"github.com/interuss/dss/pkg/api"
Expand Down Expand Up @@ -375,6 +376,7 @@ func (a *Server) GetSubscription(ctx context.Context, req *restapi.GetSubscripti
// QuerySubscriptions queries existing subscriptions in the given bounds.
func (a *Server) QuerySubscriptions(ctx context.Context, req *restapi.QuerySubscriptionsRequest,
) restapi.QuerySubscriptionsResponseSet {
nowMarker := time.Now()
if req.Auth.Error != nil {
resp := restapi.QuerySubscriptionsResponseSet{}
setAuthError(ctx, stacktrace.Propagate(req.Auth.Error, "Auth failed"), &resp.Response401, &resp.Response403, &resp.Response500)
Expand Down Expand Up @@ -419,7 +421,10 @@ func (a *Server) QuerySubscriptions(ctx context.Context, req *restapi.QuerySubsc
Subscriptions: make([]restapi.Subscription, 0),
}
for _, sub := range subs {
if sub.Manager == dssmodels.Manager(*req.Auth.ClientID) {
// Do not return subscriptions which are expired.
// This implementation decision is described and motivated in https://github.com/interuss/tsc/pull/12.
isExpired := sub.EndTime.Before(nowMarker)
if !isExpired && sub.Manager == dssmodels.Manager(*req.Auth.ClientID) {
// Get dependent Operations
dependentOps, err := r.GetDependentOperationalIntents(ctx, sub.ID)
if err != nil {
Expand Down

0 comments on commit 79a5b7e

Please sign in to comment.