Skip to content

Use UserTimeline for all of the timeline events#18

Open
hellcp wants to merge 1 commit into
pebble-dev:masterfrom
hellcp:user-timeline
Open

Use UserTimeline for all of the timeline events#18
hellcp wants to merge 1 commit into
pebble-dev:masterfrom
hellcp:user-timeline

Conversation

@hellcp

@hellcp hellcp commented Apr 7, 2026

Copy link
Copy Markdown
Member

Also handles the pins after subscription has been added or removed

Not tested

Also handles the pins after subscription has been added or removed

Not tested
Comment thread timeline_sync/api.py

# Add pins user now has a subscription for
for pin in topic.pins:
user_timeline = UserTimeline(user_id=subscription.user_id,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user_timeline may already exist for another subscribed topic

Comment thread timeline_sync/api.py
item=pin)
db.session.add(user_timeline)

user_timeline = UserTimeline(user_id=user_id, type='timeline.topic.subscription', item=topic)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented into if subscription is None:, but this user_timeline may also already exist for this subscription if the user is resubscribing after unsubscribing

Comment thread timeline_sync/api.py

# Clean up pins user no longer has a subscription for
for pin in topic.pins:
user_timeline = UserTimeline(user_id=subscription.user_id,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user_timeline probably already exists

Comment thread timeline_sync/api.py

db.session.add(glance)

user_timeline = UserTimeline(user_id=user_id, type='appglance.slice.create', item=glance)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This user_timeline may already exist, since glances never go away

@hellcp

hellcp commented Apr 13, 2026

Copy link
Copy Markdown
Member Author

Does AppGlance object still make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant