Skip to content

Filter future-dated posts from appearing in timelines #199

@dahlia

Description

@dahlia

Problem

Currently, Hollo accepts and displays all remote posts regardless of their timestamp, including posts with dates set far in the future. This can cause timeline pollution where malicious or misconfigured remote posts with future timestamps permanently stay at the top of timelines, disrupting the chronological order and user experience.

Proposed Solution

Instead of rejecting future-dated posts entirely (which could cause issues with slight server time differences), we should filter them at the timeline display level. This approach preserves the posts in the database while preventing them from appearing in timelines until their timestamp becomes current.

The solution involves adding a filter condition to all timeline queries: posts.published <= CURRENT_TIMESTAMP + INTERVAL '5 minutes'. The 5-minute tolerance accounts for reasonable server time synchronization differences between federated instances. This filter should be applied to all timeline endpoints: public, home, list, and tag timelines. The tolerance value should be configurable via an environment variable (e.g., FUTURE_POST_TOLERANCE_MINUTES) to allow administrators to adjust it based on their federation network's characteristics.

Benefits

This approach maintains data integrity by preserving all received posts while solving the timeline pollution issue. Posts with future timestamps will naturally appear in timelines once their publication time arrives. The implementation requires minimal code changes (adding one condition to existing queries) and has no performance impact since the published column is already indexed. The configurable tolerance interval allows administrators to fine-tune the filtering based on their specific federation environment's time synchronization characteristics.

Implementation

The changes would primarily affect src/api/v1/timelines.ts, where each timeline endpoint's database query would include the future post filtering condition alongside existing filters for muted/blocked accounts and visibility restrictions.

Testing

For testing purposes, here's an example of a future-dated post that demonstrates the issue: https://bsky.brid.gy/convert/ap/at://did:plc:ppk763j7o2wkinvzuqx4orrb/app.bsky.feed.post/3luiefkkrq22w (timestamped as January 1, 2026 00:00:00, which is still in the future as of August 2025).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions