Hey all,

I've been troubleshooting an issue where expired tickets aren't getting 
cleaned up when using the GoogleCloudFirestoreTicketRegistry. After digging 
through the code, I think I found the reason why — and it seems like it 
might be a bug or at least an oversight.

In DefaultTicketRegistryCleaner, the cleaner does this:
java
CopyEdit
try (val expiredTickets = ticketRegistry.stream() .filter(Objects::nonNull) 
.filter(Ticket::isExpired)) { expiredTickets.forEach(ticket -> { 
LOGGER.debug("Cleaning up expired ticket [{}]", ticket.getId()); 
ticketRegistry.deleteSingleTicket(ticket); }); } 

So it’s expecting to stream *all* tickets, then filter the expired ones.

But in the Firestore implementation, the getTickets() method already 
filters out expired tickets *before* returning them:
java
CopyEdit
.filter(ticket -> !ticket.isExpired()) 

That means ticketRegistry.stream() never includes expired tickets in the 
first place — so the cleaner never sees anything to delete. No logs, no 
cleanup, nothing.

Is that filtering supposed to be there? It seems like the registry should 
return *everything* and let the cleaner decide what to do with them. 
Otherwise, expired tickets just sit in Firestore forever.

Anyone else run into this? Am I missing something?

-- 
- Website: https://apereo.github.io/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/ea7e92f5-e99a-44b8-8fc8-33dcbea8a21an%40apereo.org.

Reply via email to