-
Notifications
You must be signed in to change notification settings - Fork 6.1k
fix: Resolve event delivery configuration header passing between frontend and backend #7514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ction 📝 (NodeStatus/index.tsx): refactor config variable to eventDeliveryConfig for better readability 📝 (api.tsx): add EventDeliveryType enum import and update config import to include EventDeliveryType 📝 (use-get-config.ts): add support for setting event delivery type in utility store 📝 (new-modal.tsx): refactor config variable to eventDeliveryConfig for better readability 📝 (utilityStore.ts): add default event delivery type to utility store 📝 (index.ts): add eventDelivery type to UtilityStoreType 📝 (buildUtils.ts): add support for passing event delivery config to performStreamingRequest function
…very to direct for FE tests
…astAPI request object for further processing
…elivery types in build functions 📝 (utils.py): Define EventDeliveryType enum with streaming, direct, and polling options for event delivery 📝 (chat.py): Add EventDeliveryType enum to support different event delivery types in chat functions 📝 (chat.py): Add event_delivery parameter with default streaming type to build_flow function 📝 (chat.py): Update build_flow function to use event_delivery parameter for event delivery type 📝 (chat.py): Update get_build_events function to use event_delivery parameter for event delivery type 📝 (build_utils.py): Import Enum class for EventDeliveryType in build_utils 📝 (api.tsx): Remove eventDeliveryConfig parameter and related logic from performStreamingRequest function 📝 (buildUtils.ts): Update BuildVerticesParams type to include mandatory stream and eventDelivery properties 📝 (buildUtils.ts): Update buildFlowVerticesWithFallback function to use EventDeliveryType.POLLING when streaming is not supported 📝 (buildUtils.ts): Update pollBuildEvents function to use EventDeliveryType.POLLING for event delivery 📝 (buildUtils.ts): Update buildFlowVertices function to use eventDelivery parameter for event delivery type
…f EventDeliveryType values for better logic 📝 (utils.py): reorder imports to follow PEP8 guidelines and improve code readability 📝 (chat.py): refactor condition to check if EventDeliveryType.DIRECT is not in a list of event_delivery values for clarity 📝 (build_utils.py): remove unused import statement for Enum to clean up code
…function to clean up code and improve maintainability
…/langflow into cz/fix-event-delivery-direct
ogabrielluiz
requested changes
Apr 9, 2025
src/frontend/src/controllers/API/queries/config/use-get-config.ts
Outdated
Show resolved
Hide resolved
ogabrielluiz
requested changes
Apr 9, 2025
// Then stream the events | ||
const eventsUrl = `${BASE_URL_API}build/${job_id}/events`; | ||
const buildResults: Array<boolean> = []; | ||
const verticesStartTimeMs: Map<string, number> = new Map(); | ||
|
||
if (stream) { | ||
if (eventDelivery === EventDeliveryType.STREAMING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#7526 will help with this. let's push this PR and then we fix this
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
…dUtils.ts): remove unused shouldStreamEvents function and stream property from buildFlow function to clean up code and improve maintainability.
…/langflow into cz/fix-event-delivery-direct
…to clean up code and improve maintainability
ogabrielluiz
approved these changes
Apr 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to handle event delivery configurations more effectively in both the backend and frontend. The key updates include adding a new request parameter for event delivery, updating utility store configurations, and modifying various components to use the new event delivery configuration.
Backend Changes:
request
parameter to thebuild_flow
function inchat.py
to access request headers.build_flow
function to check the "X-Event-Delivery" header and adjust the event delivery method accordingly.Frontend Changes:
config.data?.event_delivery
witheventDeliveryConfig
inNodeStatus
andIOModal
components to use the new utility store state. [1] [2] [3] [4] [5] [6]eventDeliveryConfig
parameter toStreamingRequestParams
and updated theperformStreamingRequest
function to include the "X-Event-Delivery" header if the configuration is "direct". [1] [2]useGetConfig
hook to set the event delivery type in the utility store. [1] [2]eventDelivery
state andsetEventDelivery
method to the utility store. [1] [2] [3] [4]buildFlowVertices
function to passeventDeliveryConfig
toperformStreamingRequest
. [1] [2]