Smokesignal Changelog#
Major Bug Fixes & Feature Improvements (2025-06-04)#
This release addresses multiple critical issues that were preventing the smokesignal application from working correctly. The application was previously showing "it doesn't work" behavior due to several interconnected problems.
🐛 Primary Bug Fix: Homepage showing too many events (120 instead of 12)#
Problem: The homepage was displaying 120 events instead of the expected 12 events (2 upcoming + 10 recent). This was caused by a template loop bug where the event_list.*.incl.html template had its own loop that was being called from within another loop in the main template.
Root Cause:
- Homepage template looped through
upcoming_events(2 events) and includedevent_list.*.incl.htmlfor each - Homepage template looped through
events(10 recent events) and includedevent_list.*.incl.htmlfor each - The included
event_list.*.incl.htmltemplate had its own{% for event in events %}loop that rendered all 10 recent events - Result: 2 × 10 + 10 × 10 = 120 events displayed
Solution: Created separate single-event templates for homepage use while preserving the original templates for the events filter page.
🔧 Secondary Bug Fix: Pagination System Not Working Properly#
Problem: The homepage pagination logic was inconsistent - extracting page_size from pagination but then hard-coding database calls to use 10.
Solution:
- Implemented proper
page_size + 1pattern for pagination detection - Fixed database queries to use extracted
page_sizeconsistently - Added proper truncation logic with debug logging
🌐 Bug Fix: Timezone Detection Middleware Failing#
Problem: User timezone detection wasn't working, causing date/time display issues.
Solution:
- Enhanced timezone middleware to detect user IP via X-Forwarded-For headers
- Integrated worldtimeapi.org for accurate timezone detection
- Added proper error handling and fallback mechanisms
🌍 Bug Fix: Internationalization (i18n) System Issues#
Problem: Language detection and switching between French Canadian (fr-CA) and English (en-US) wasn't working correctly.
Solution:
- Improved i18n middleware with proper Accept-Language header parsing
- Enhanced language negotiation with fallback chains
- Added missing translation strings in both languages
🔍 Bug Fix: Event Filtering System Incomplete#
Problem: The /events filter page wasn't working - missing search, date filtering, and location filtering.
Solution:
- Implemented comprehensive filtering system with facets
- Added text search, date range filtering, and location-based filtering
- Enhanced query builder with proper SQL generation
- Added geolocation support with radius-based filtering
📊 Bug Fix: Database Query Performance & Data Hydration#
Problem: Missing RSVP counts, organizer information, and inefficient database queries.
Solution:
- Implemented proper event hydration system
- Added RSVP count aggregation
- Enhanced organizer handle resolution
- Optimized database queries with proper joins
🎨 Bug Fix: Template Rendering Issues#
Problem: Templates not rendering correctly with proper data binding and includes.
Solution:
📁 Files Changed#
✅ New Files Added:#
templates/single_event.en-us.incl.html- Single event template for homepage (English)templates/single_event.fr-ca.incl.html- Single event template for homepage (French)i18n/en-us/filters.ftl- Filter-related translations (English)i18n/fr-ca/filters.ftl- Filter-related translations (French)src/bin/debug_next_week.rs- Debug utility for week calculationssrc/bin/test_date_ranges.rs- Debug utility for date range testinglog.txt- Application logs
🔧 Modified Files:#
Core Logic:
src/http/handle_index.rs- Fixed pagination logic, removed unused imports and variablessrc/http/handle_filter_events.rs- Enhanced filtering functionalitysrc/http/middleware_filter.rs- Improved filter middlewaresrc/filtering/query_builder.rs- Enhanced query building capabilitiessrc/filtering/facets.rs- Improved facet handlingsrc/filtering/hydration.rs- Enhanced event hydration
Templates:
templates/index.en-us.common.html- Updated to usesingle_event.*.incl.htmltemplates/index.fr-ca.common.html- Updated to usesingle_event.*.incl.htmltemplates/event_list.en-us.incl.html- Restored original loop structure for filter pagetemplates/event_list.fr-ca.incl.html- Restored original loop structure for filter pagetemplates/filter_events.common.html- Enhanced filtering interfacetemplates/filter_events_results.incl.html- Improved results display
Internationalization:
i18n/en-us/common.ftl- Updated common translationsi18n/en-us/forms.ftl- Enhanced form translationsi18n/en-us/ui.ftl- Cleaned up UI translationsi18n/fr-ca/common.ftl- Updated common translationsi18n/fr-ca/forms.ftl- Enhanced form translationsi18n/fr-ca/ui.ftl- Cleaned up UI translations
Infrastructure:
src/bin/smokesignal.rs- Minor configuration updatessrc/http/middleware_i18n.rs- Improved language handlingsrc/http/middleware_timezone.rs- Enhanced timezone processing- Various other middleware and utility files
🗑️ Deleted Files:#
templates/archive/filter_events.en-us.common.html- Archived old filter templatetemplates/archive/filter_events.fr-ca.common.html- Archived old filter templatetemplates/archive/filter_events_results.en-us.incl.html- Archived old results templatetemplates/archive/filter_events_results.fr-ca.incl.html- Archived old results template
🔧 Technical Details#
Before Fix:
Homepage Template Loop:
├── upcoming_events (2 items)
│ └── each calls event_list.*.incl.html
│ └── loops through all events (10 items) = 20 events
└── events (10 items)
└── each calls event_list.*.incl.html
└── loops through all events (10 items) = 100 events
Total: 120 events displayed
After Fix:
Homepage Template Loop:
├── upcoming_events (2 items)
│ └── each calls single_event.*.incl.html
│ └── renders 1 event = 2 events
└── events (10 items)
└── each calls single_event.*.incl.html
└── renders 1 event = 10 events
Total: 12 events displayed ✅
Filter Page (unchanged):
Filter Results Template:
└── calls event_list.*.incl.html
└── loops through filtered events
└── renders all results correctly ✅
✅ Result#
- ✅ Homepage now correctly displays 12 events maximum (2 upcoming + 10 recent)
- ✅ Filter page continues to work correctly with all events
- ✅ Pagination system working as intended
- ✅ All compiler warnings cleaned up
- ✅ Both English and French templates working
- ✅ No breaking changes to existing functionality
🧪 Verification#
- Backend logs confirm:
upcoming_events.len()=2, recent_events.len()=11(11 fetched, 10 displayed) - Frontend displays exactly 12 events total
- Event filter page (/events) continues to display full event lists correctly
- All HTMX functionality preserved