ios in-app purchase auto-renewable subscriptions upgrade and downgrade

my app is in-app purchase with auto-renewable subscriptions
after buying subscription
1- i chose to upgrade to other product
i got popup asking me do you want to upgrade and will get refund i press confirm

2-after seconds i chose to upgrade again to higher subscription
i got popup asking me do you want modify your subscription and subscription plan will begin and you will charged when current subscription expires

my question when i upgrade for the second time why i did not get the same first popup to ask me to upgrade ? why there is no refund ?

what does the second popup mean its upgrade or downgrade ? should i updated my sever directly with the new plan ?



Forgot to mention that I'm on the sandbox environment at the moment.


Any help is highly appreciated.
The second popup in your description is either for a downgrade or for a cross-grade between subscriptions having the same service level but different durations. If you want to make it an upgrade, make sure the second subscription is ranked higher than the first one in App Store Connect:

Resources:
https://developer.apple.com/app-store/subscriptions/#ranking
when user downgrade subscription does the new plan start immediately ?

in documentations :

The subscription continues until the next renewal date, then is renewed at the lower level and price.


so if this is downgrade or for a cross-grade between subscriptions the user the plan should not begin now correct ?

 but the popup i am getting its saying your subscription plan will begin and you will be charged when your current subscription expires


what i understand from the popup the user will get the downgrade plan immediately and pay the new price after expires that correct ?


Replying to @Louna and OP's post.

What I understood

The description is correct for downgrade.

Look here: https://developer.apple.com/documentation/appstoreservernotifications/notificationtype (PS: I hope this link works even after 10 years)

We have DID_CHANGE_RENEWAL_PREF in that for subtype DOWNGRADE.

It says: the user downgraded or cross-graded their subscription. Downgrades take effect at the next renewal and don’t affect the currently active plan.

Now after getting the basic theory from the docs: Let's say we have two product id P1 and P2. They belong to the same Subscription Groups under Auto-Renewable Subscriptions. Here P1 (yearly) is at top and P2(monthly) after that with ORDER 1 and 2 respectively.

Order in which we encounter downgrade.

  1. Bought yearly plan P1. Money is deducted. validity is for 1 year,
  2. Downgrades to plan P2 from app store subscription settings. Money is not deducted immediately (I think still want some apple developers to verify). Plan will come into effect after the validity of Plan P1 expires.

Now coming to sandbox environment, it has tons of issues. Refer this: https://developer.apple.com/forums/thread/706309

The plan list which comes while you're planning to test upgrade/downgrade/crossgrade is in random order not following any patterns( if you have more than 3 plans in same subscription groups, you will encounter this.) and yes you can access this list in your sandbox environment. Head to Sandbox signin and their go to Edit subscriptions

ios in-app purchase auto-renewable subscriptions upgrade and downgrade
 
 
Q