Skip to content

Commit

Permalink
Only omit unused args when calling "use cache" functions
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Nov 12, 2024
1 parent 9624314 commit c146cbf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ async function fetchServerAction(
): Promise<FetchServerActionResult> {
const temporaryReferences = createTemporaryReferenceSet()
const info = extractInfoFromServerReferenceId(actionId)
const usedArgs = omitUnusedArgs(actionArgs, info)

// TODO: Currently, we're only omitting unused args for the experimental "use
// cache" functions. Once the server reference info byte feature is stable, we
// should apply this to server actions as well.
const usedArgs =
info.type === 'use-cache' ? omitUnusedArgs(actionArgs, info) : actionArgs

const body = await encodeReply(usedArgs, { temporaryReferences })

const res = await fetch('', {
Expand Down

0 comments on commit c146cbf

Please sign in to comment.