posthog-ios icon indicating copy to clipboard operation
posthog-ios copied to clipboard

chore(flags): use new `/flags` endpoint instead of `/decide`

Open dmarticus opened this issue 7 months ago • 5 comments

:bulb: Motivation and Context

Update the iOS SDK to use the new /flags endpoint instead of the legacy /decide one.

dmarticus avatar Apr 28 '25 23:04 dmarticus

@ioannisj can you review it? Also, I'd debug https://github.com/PostHog/posthog-ios/issues/344 first since its a different endpoint now (and likely easier to reproduce if there's a bug)

marandaneto avatar Apr 29 '25 06:04 marandaneto

@dmarticus Getting a 400 Bad Request - Failed to decode request: unsupported content type: application/json; charset=utf-8. Please check your request format and try again. when testing on a demo project.

Other than this and reverting the commit from ./scripts/prepare-release.sh that @marandaneto mentioned, LG to me. I don't see any other logic other than changing the endpoint affected

ioannisj avatar Apr 29 '25 13:04 ioannisj

@ioannisj I fixed the issue with https://github.com/PostHog/posthog/pull/31798, can you give it a try on your side again?

dmarticus avatar Apr 30 '25 23:04 dmarticus

@ioannisj I fixed the issue with https://github.com/PostHog/posthog/pull/31798, can you give it a try on your side again?

Yeah getting a response now. We need to think how sessionRecording should be handled though cause we depend on that on /decide endpoint (talked about this privately already)

ioannisj avatar May 02 '25 09:05 ioannisj

similar to https://github.com/PostHog/posthog-android/pull/245#issuecomment-2893824253 but here https://github.com/PostHog/posthog-ios/blob/479ce5ba9ce899dfe969dea7c88cd110adb800e7/PostHog/PostHogRemoteConfig.swift#L187C18-L187C35 and probably more places, @ioannisj would know more

marandaneto avatar May 20 '25 10:05 marandaneto

@ioannisj with this commit ce2f2ac (#345) I've added support for all of the /decide fields to the /flags endpoint, how does this look to you?

dmarticus avatar Jun 09 '25 23:06 dmarticus