Skip to content

Old API used in Tanstack Query provider #5509

@Onxi95

Description

@Onxi95

Describe the issue

  • Tanstack query changed its API in v5, renaming cacheTime to gcTime.
  • Since v4, query keys are always arrays

maas-ui version
maas-ui 3.6.0

Expected behavior

type QueryOptions = NonNullable<DefaultOptions>["queries"];

export const defaultQueryOptions: QueryOptions = {
  staleTime: 5 * 60 * 1000, // 5 minutes
  gcTime: 15 * 60 * 1000, // 15 minutes
  refetchOnWindowFocus: true,
};

export const realTimeQueryOptions: QueryOptions = {
  staleTime: 0,
  gcTime: 60 * 1000, // 1 minute
};
  • ternary from base.tsx might be removed
const queryModelKey = Array.isArray(queryKey) ? queryKey[0] : ""; // const queryModelKey = queryKey[0];

Additional context


Recently, I was experimenting with different cloud solutions, but then I found MAAS - looks quite interesting!

By statically reading the code, I found these small improvements. Unfortunately, I can't open a PR with my proposal as I have some issues with the local websocket proxy server - it seems like the MAAS local instance closes the connection immediately. "I'll try to prepare a reproduction demo on Ubuntu in the future. If the problem recurs, I'll open an issue on Launchpad. 🤞

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions