Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscriber gems not bought #18

Open
ramotar opened this issue May 3, 2023 · 7 comments
Open

Subscriber gems not bought #18

ramotar opened this issue May 3, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@ramotar
Copy link

ramotar commented May 3, 2023

What is the bug?
When trying to buy subscriber gems, my active subscription isn't detected properly.

Additional context
I already debugged the function purchaseGems() and the first if clause evaluates to false.
For reference, here is the content of my plan (without customerId):

{ consecutive: { count: 2, offset: 10, gemCapExtra: 20, trinkets: 0 },
  quantity: 1,
  extraMonths: 0,
  perkMonthCount: 0,
  gemsBought: 0,
  mysteryItems: [],
  dateUpdated: '2023-05-01T07:03:10.349Z',
  customerId: '######################',
  dateCreated: '2023-03-28T17:51:15.650Z',
  dateCurrentTypeCreated: '2023-03-28T17:51:15.650Z',
  dateTerminated: null,
  lastReminderDate: null,
  owner: 'b477462a-5bb5-4040-9505-f0b049b4f0bb',
  paymentMethod: 'Paypal',
  planId: 'basic_12mo' }

How often does this happen?
On every try.

Script version
Automate Habitica v0.29.32 (beta) by @bumbleshoot

Script settings

const AUTO_CRON = false; // true or false

const AUTO_ACCEPT_QUEST_INVITES = true;

const FORCE_START_QUESTS = false; // party leaders only
const FORCE_START_QUESTS_AFTER_HOURS = 1; // eg. if set to 1, quests will force start after 1h
const NOTIFY_MEMBERS_EXCLUDED_FROM_QUEST = false;

const AUTO_INVITE_GOLD_QUESTS = false;
const AUTO_INVITE_UNLOCKABLE_QUESTS = false;
const AUTO_INVITE_PET_QUESTS = false;
const AUTO_INVITE_HOURGLASS_QUESTS = false;
const PM_WHEN_OUT_OF_QUEST_SCROLLS = false;

const NOTIFY_ON_QUEST_END = true;

const AUTO_CAST_SKILLS = true;

const AUTO_PAUSE_RESUME_DAMAGE = false;
const MAX_PLAYER_DAMAGE = 20;
const MAX_PARTY_DAMAGE = 5;

const AUTO_ALLOCATE_STAT_POINTS = true;
const STAT_TO_ALLOCATE = "str"; // str, int, con, per

const AUTO_PURCHASE_GEMS = true; // subscribers only

const AUTO_PURCHASE_ARMOIRES = true;
const RESERVE_GOLD = 10000;

const AUTO_SELL_EGGS = false;
const RESERVE_EGGS = 999;

const AUTO_SELL_HATCHING_POTIONS = false;
const RESERVE_HATCHING_POTIONS = 999;

const AUTO_SELL_FOOD = false;
const RESERVE_FOOD = 999;

const AUTO_HATCH_FEED_PETS = true;
const ONLY_USE_DROP_FOOD = true;

const HIDE_PARTY_NOTIFICATIONS = false;
const HIDE_ALL_GUILD_NOTIFICATIONS = false;
const HIDE_NOTIFICATIONS_FROM_SPECIFIC_GUILDS = [ // only used if HIDE_ALL_GUILD_NOTIFICATIONS is false
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // enter a guild ID between the quotes to hide notifications from that guild
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // repeat for as many guilds as you want
]
@ramotar ramotar added the bug Something isn't working label May 3, 2023
@ramotar ramotar changed the title Subcriber gems not bought Subscriber gems not bought May 3, 2023
@ramotar
Copy link
Author

ramotar commented May 3, 2023

if (
  (plan.dateTerminated && new Date(plan.dateTerminated).getTime() > new Date().getTime())
  || (plan.dateTerminated === null && plan.customerId === "group-plan")
) {

Actually I understand the first part: If the plan has a termination date, check if it isn't expired.
But how did you come up with the second part? My customerId is actually entirely different.

I couldn't find any information in the API on how to properly check, if a user is still a subscriber ...

@bumbleshoot
Copy link
Owner

Hi @ramotar, what kind of subscription plan are you on?

@ramotar
Copy link
Author

ramotar commented May 4, 2023

I have an uncanceled 12 month subscription as indicated by the planId

@bumbleshoot
Copy link
Owner

Hi @ramotar, thanks for bringing this to my attention and thanks for your patience! I am collecting more data on various subscription types so I can rewrite the algorithm that checks for subscription benefits. I'll let you know as soon as I've released a fix for this issue. :)

@bumbleshoot
Copy link
Owner

Hi @ramotar, thanks again for your patience. I just got COVID for the first time and I am finally recovered, so I am catching up on work and tasks. Can you please let me know whether you've ever received a gift subscription from another Habitica user? Thanks!

@bumbleshoot
Copy link
Owner

Hi @ramotar, did you see my latest comment? Still need this info from you so I can proceed with the troubleshooting. :)

@ramotar
Copy link
Author

ramotar commented Jan 17, 2024

Hey @bumbleshoot,
might have gone unnoticed, sorry ... no, I never received a gift subscription :)
Thanks for staying on this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants