Urgent Fix: Broken API Filter Crippling Event Discovery
Hey guys, we've got a major problem on our hands. Our API filtering system is completely toast, and it's making it impossible for users to find events. This is a critical issue, and we need to get it fixed ASAP. Let's dive into what's broken, how we're fixing it, and what we need to do to get everything back on track.
The Disaster: What's Broken with the API Filtering System
So, here's the deal. Our API filtering system, the thing that lets users narrow down events by category, type, location, date, and search terms, is utterly failing. This means users can't find the events they want, which is, well, a disaster. It's like having a library with no card catalog – completely useless.
The core of the problem boils down to a bunch of mismatches and missing pieces between how the frontend (what the user sees and interacts with) and the backend (where the data lives and the filtering happens) talk to each other. Think of it like trying to have a conversation with someone who speaks a different language and uses different words for the same things. It just doesn't work.
The Root of the Problem: Parameter Name Chaos
The first big issue is a serious case of parameter name confusion. The frontend is sending one set of parameters, while the backend is expecting a completely different set. This is like the frontend saying “Hey, I want all events in the ‘city’” and the backend saying, “Huh? You mean ‘location’?”
Here's a breakdown of the parameter name mismatch:
- Frontend Sends:
category
,eventType
,city
,searchQuery
,startDate
,endDate
- Backend Expected:
location
,date_start
,date_end
,tags
As you can see, it’s a mess. This means that when the frontend asks for something, the backend either doesn't understand or misinterprets the request. It's like trying to order a pizza but accidentally asking for a pair of shoes.
Data Type Mismatches: A Backend's Worst Nightmare
But the problems don't stop there, because the data types themselves are also creating conflicts. The backend stores EventCategory
and EventType
as enums. However, the code was comparing them as strings, meaning that it was trying to compare apples and oranges. This is like trying to compare the color blue to the word “blue”.
This is critical, because filtering by category and event type, which are key components of the filter system, are completely broken as a result. Users couldn't filter by these important criteria, which severely limits the value of our event discovery functionality.
Missing Logic: A Black Hole in the System
To add insult to injury, there was also some missing logic. The system simply didn't have the code to support city filtering or search queries. It was as if these features had never been implemented. Furthermore, date filtering, which is fundamental for users to find events happening during their desired time frame, was using the wrong relationships.
This means that even when the parameters were correctly named and the data types matched, the system couldn't actually do what it was supposed to do.
The Impact: Why This Matters
So, what's the big deal? Why are we sounding the alarm? Because the impact of this broken filtering system is huge.
Event Filtering: Completely Non-Functional
The most obvious impact is that event filtering is completely non-functional. Users can't refine their search based on their preferences. This means users can’t easily find events that interest them.
A Broken User Experience
It's like visiting a website and having all the search and filter functions stop working, which is a terrible experience and makes the site unusable. In this case, users are unable to narrow down events based on category, type, city, or date range.
Search Functionality Crippled
Search functionality is also broken. Search is a core component of event discovery. When search goes down, so does event discovery.
Event Discovery: Unusable
The ultimate consequence of all of this is that event discovery becomes nearly impossible. Users can't find the events they're looking for, and the entire event discovery process is essentially broken.
This is a critical issue that directly impacts our users and business. We need a solution ASAP.
Current Status: Partial Fixes and Roadblocks
So, where do we stand now? Here’s a breakdown of the current status:
Partially Fixed: Progress Made
We've made some progress. The team has updated the EventController
parameters and the EventSpecification
logic to address some of the parameter mismatches and data type issues. This is a good start, and it's a testament to the team's hard work. It's like fixing the engine of a car – we've started to address the core problems.
Blocked: Roadblocks Ahead
However, we're not completely out of the woods yet. The primary roadblock is compilation issues caused by test conflicts. These conflicts are preventing us from doing thorough testing to ensure that all the fixes are working correctly. It's like trying to drive a car that won't pass inspection – we can't release it until we know it's safe.
Needs: What We Still Need
To fully resolve the problem, we need to complete integration testing and verification. This involves thoroughly testing the system to ensure that all the fixes are working correctly and that all the filtering features are functioning as expected.
Acceptance Criteria: What Success Looks Like
To ensure we've completely fixed the problems, we've established the following acceptance criteria. We'll only consider this problem solved when we meet these criteria:
- All Frontend Filter Parameters Work Correctly: All parameters passed from the frontend to the backend will work as expected. This is like making sure that the car's steering wheel, accelerator, and brakes all function properly.
- Category Filtering Returns Matching Events: Category filtering will only return events that match the selected category. This is like making sure that when you select "sports", only sports events are displayed.
- Event Type Filtering Works (IN_PERSON, VIRTUAL, HYBRID): Users can filter by event type (in-person, virtual, or hybrid). This ensures users can find events based on their preferred format.
- City Filtering Works with Partial Matching: Users should be able to search by city with partial matching. For example, searching for