Skip to content

Add MetaTag support for backwards compatibility with ProfileService#18

Open
walkerrobertben wants to merge 1 commit intoMadStudioRoblox:mainfrom
elppot:support-legacy-meta-tag-methods
Open

Add MetaTag support for backwards compatibility with ProfileService#18
walkerrobertben wants to merge 1 commit intoMadStudioRoblox:mainfrom
elppot:support-legacy-meta-tag-methods

Conversation

@walkerrobertben
Copy link

Add MetaTag support for backwards compatibility with ProfileService

Overview

This PR adds Profile:GetMetaTag() and Profile:SetMetaTag() methods to ProfileStore, providing backwards compatibility with ProfileService's MetaTag functionality. These methods allow storing and retrieving metadata separate from Profile.Data, which persists to Profile.MetaData.MetaTags when profiles are saved.

Motivation

As a long-term ProfileService user migrating to ProfileStore, I needed to maintain compatibility with existing code that relies on MetaTags. ProfileStore removes MetaTags in favor of Profile.LastSavedData for data verification. My custom version control system depends on MetaTags for tracking changes, and since ProfileStore is otherwise functionally backwards-compatible, adding these methods was the minimal change needed to complete the migration.

Changes Made

  • ProfileStore.luau:
    • Added MetaTags field to Profile instances, initialized from raw_data.MetaData.MetaTags
    • Modified save logic to persist profile.MetaTags to latest_data.MetaData.MetaTags
    • Added Profile:GetMetaTag(tag_name) and Profile:SetMetaTag(tag_name, value) methods with input validation
  • ProfileStoreTest.server.luau:
    • Added test to verify MetaTag persistence through save/load cycles
  • docs/api.md:
    • Documented the new GetMetaTag and SetMetaTag methods with usage examples and backwards compatibility notes
  • docs/index.md:
    • Updated the "Changes from ProfileService" section to mention the compatibility methods

Testing

  • All existing tests pass
  • New test validates that MetaTags are correctly saved and retrieved across profile sessions
  • Tested with both mock and live DataStore modes

Compatibility

These methods are purely additive and do not affect existing ProfileStore functionality. They exist solely for legacy ProfileService integrations that require MetaTag access. The documentation clearly marks them as legacy support methods.

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