Skip to content

[P1] Dual DB write path — SQLite vs Postgres inconsistency #5

Description

@ShadowWalkerNC

Summary

Some routes use get_db() (raw SQLite via g._database) while UserManager.log_post() writes through a separate abstraction (likely a Postgres-backed connection). Affected routes: api_post_history, api_scheduled_posts, api_delete_post.

Impact

On Railway (Postgres), these routes will read from SQLite and write to Postgres, or vice versa. Post history will appear empty or double-write depending on the runtime environment. Nearly impossible to reproduce in local dev.

Fix

Pick one database abstraction (recommend modules/db.py Postgres path) and migrate all routes to use it. Remove get_db() / g._database once fully migrated.

Effort: 1–2 days

Part of full audit: #1

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions