Skip to content

Paid plugin discontinuation#37

Open
deadlyjack wants to merge 7 commits intomainfrom
paid-plugin-discontinuation
Open

Paid plugin discontinuation#37
deadlyjack wants to merge 7 commits intomainfrom
paid-plugin-discontinuation

Conversation

@deadlyjack
Copy link
Copy Markdown
Member

No description provided.

Ajit Kumar added 2 commits April 6, 2026 09:53
- Implement EmailUsers component to allow sending emails to users based on filters.
- Add API endpoints for fetching email recipient counts and sending emails.
- Update user entity methods to support filtering users for email sending.
- Enhance styles for the email form in the admin panel.
- Update home page subtitle for better clarity.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 6, 2026

Greptile Summary

This PR discontinues paid plugin support in Acode by deactivating existing paid plugins via a one-time migration script, removing the Google Play in-app product (registerSKU) registration logic from the plugin API, blocking new paid plugin submissions at both the UI and server validation levels, and adding an admin panel feature to email affected users. The core discontinuation logic is sound, but the new admin email feature has a couple of correctness issues worth fixing before merging.

  • Bulk email sends are sequential and blocking — the /send-email endpoint awaits every SMTP send in a for...of loop before responding; for large user lists this will hit HTTP timeouts.
  • Two new fetch URLs in EmailUsers are missing a leading /api/admin/email-recipients-count and api/admin/send-email should be /api/admin/... to match the rest of the codebase and avoid path-relative resolution bugs.
  • fetchCount has no error handling — a failed request silently stalls the recipient counter.
  • Migration script may hangdeactivatePaidPlugins.js does not call process.exit() or close the DB connection after running, which can leave the Node process alive.
  • The removal of registerSKU / isValidPrice is clean; androidpublisher and getPluginSKU remain correctly in use for purchase verification.

Confidence Score: 3/5

Merge with caution — the new admin email feature has logic and correctness issues that should be resolved first.

The core paid-plugin discontinuation (migration, server-side price validation, UI notice) is correct. However, the new EmailUsers admin component has a blocking sequential email loop that will timeout for any meaningful number of recipients, plus two relative fetch URLs that can silently 404 depending on routing. These are real functional bugs, not style nits, which keeps the score at 3.

server/apis/admin.js (sequential email loop may timeout) and client/pages/admin/index.js (relative fetch URLs, missing error handling in fetchCount)

Important Files Changed

Filename Overview
server/apis/admin.js Adds email recipients count and bulk send endpoints; sequential await loop in /send-email will block and timeout for large user lists
client/pages/admin/index.js Adds EmailUsers component with two relative fetch URLs missing leading slashes and no error handling in fetchCount
server/migrations/deactivatePaidPlugins.js One-time migration to deactivate approved paid plugins; correct SQL but missing process.exit() may leave the Node process hanging
server/entities/user.js Adds getUsersByFilter and countUsersByFilter with whitelisted filter values and correct parameterized SQL
server/apis/plugin.js Removes registerSKU and isValidPrice cleanly; androidpublisher and getPluginSKU remain in use for purchase verification
client/pages/publishPlugin/index.js Adds paid plugin discontinuation notice banner above the publish form; straightforward UI-only change
client/pages/plugin/index.js UI adjustments for paid plugin discontinuation; no logic issues found
client/pages/admin/style.scss Adds styles for the new EmailUsers component; no issues
client/pages/publishPlugin/style.scss Adds styles for the paid plugin notice banner; no issues
client/pages/home/index.js Minor homepage update; no issues found
client/pages/user/index.js Minor user page update; no issues found
client/jsconfig.json Path alias cleanup (removes baseUrl, fixes paths entry); no issues
client/pages/termsOfService/website-ts.md Terms of service updated to reflect paid plugin discontinuation
.vscode/settings.json Adds 'googleplay' to the spell-check dictionary
client/pages/plugin/style.scss Style updates for plugin page; no issues
readme.md Minor readme update; no issues

Sequence Diagram

sequenceDiagram
    participant Admin as Admin Browser
    participant Client as EmailUsers Component
    participant Server as Express Server
    participant DB as SQLite DB
    participant SMTP as Email (SMTP)

    Admin->>Client: Select filter
    Client->>Server: GET /api/admin/email-recipients-count?filter=...
    Server->>DB: countUsersByFilter(filter)
    DB-->>Server: { count }
    Server-->>Client: { count }
    Client-->>Admin: Show recipient count

    Admin->>Client: Enter subject & message, click Send
    Client->>Server: POST /api/admin/send-email { filter, subject, message }
    Server->>DB: getUsersByFilter(filter)
    DB-->>Server: [ user list ]
    loop For each user (sequential, blocking)
        Server->>SMTP: sendEmail(user.email, ...)
        SMTP-->>Server: OK
    end
    Server-->>Client: { sent: N }
    Client-->>Admin: Alert success
Loading

Reviews (1): Last reviewed commit: "Implement paid plugin discontinuation: u..." | Re-trigger Greptile

deadlyjack and others added 5 commits April 6, 2026 11:17
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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