Skip to content
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

[FIX] Stalwart: fix jmap 0.7.0 msg_header keys(message-id,message_id) #944

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Shadow243
Copy link
Member

@Shadow243 Shadow243 commented Apr 11, 2024

Pull Request Description

Title: Update Draft Saving Functionality for Stalwart 0.7.0 Compatibility

Description:

Issue:
In Stalwart release 0.5.0, the message ID field was consistently labeled as "message-id" in the response data when saving drafts. However, with the release of Stalwart 0.7.0, there has been a change where the message ID field is now labeled as "message_id". This inconsistency has caused issues when attempting to save drafts as our codebase was expecting the previous format.

Solution:
To ensure compatibility with Stalwart 0.7.0 and future versions, this pull request updates the draft saving functionality to handle both "message-id" and "message_id" fields in the response data. The code now checks for the existence of both keys and compares their values accordingly. This change allows our application to seamlessly handle drafts saved using both versions of Stalwart.

Changes Made:

  • Modified the draft saving logic to accommodate both "message-id" and "message_id" fields in the response data.
  • Implemented a conditional check to handle the different field names and ensure compatibility across Stalwart versions.
  • Tested the updated functionality to verify correct behavior when saving drafts with Stalwart 0.7.0.

This pull request aims to resolve the compatibility issue with Stalwart 0.7.0 and improve the robustness of our draft saving feature for future releases.

    [0] => array(
        "uid" => "eaaaaaba",
        "flags" => "",
        "internal_date" => "2024-04-11T16:52:40Z",
        "size" => 609,
        "date" => "2024-04-11T16:52:38Z",
        "from" => "Steven NG <steven@lab14.evoludata.com>",
        "to" => "muhngesteven@gmail.com",
        "subject" => "Test Stalwart release 0.7.0",
        "content-type" => "",
        "timestamp" => 1712854360,
        "charset" => "",
        "x-priority" => "",
        "type" => "jmap",
        "references" => "",
        "message_id" => "52336d427c7dcbbcc5cbb3d57a485d12@Stevens-MacBook-Pro.local",
        "x_auto_bcc" => ""
    ),
    [1] => array(
        "uid" => "d2aaaaa3",
        "flags" => "",
        "internal_date" => "2024-04-11T16:52:03Z",
        "size" => 615,
        "date" => "2024-04-11T16:52:02Z",
        "from" => "Steven NG <steven@lab14.evoludata.com>",
        "to" => "muhngesteven@gmail.com",
        "subject" => "Test Stalwart release 0.7.0",
        "content-type" => "",
        "timestamp" => 1712854323,
        "charset" => "",
        "x-priority" => "",
        "type" => "jmap",
        "references" => "",
        "message_id" => "db0bd6557d9ae16ebce56259ba73fbd6@Stevens-MacBook-Pro.local",
        "x_auto_bcc" => ""
    ),
    [2] => array(
        // and so on for the remaining elements...
    ),
    // Remaining elements truncated for brevity
}

Related Issue: #931

@Shadow243
Copy link
Member Author

I'm getting a blank page(White page) after I click on Send Button. I'l add a commit about that to this PR.

@Shadow243 Shadow243 marked this pull request as draft April 11, 2024 17:27
@Shadow243
Copy link
Member Author

I'm getting a blank page(White page) after I click on Send Button. I'l add a commit about that to this PR.

I'm encountering the same error with Migadu.com, and it seems to be an issue not just with Stalwart but also with other services. I'll need to address this issue before proceeding, as I haven't been able to send mail with Stalwart due to this issue.

@Shadow243 Shadow243 marked this pull request as ready for review April 12, 2024 13:16
@marclaporte
Copy link
Member

Spin off: #945

modules/smtp/modules.php Outdated Show resolved Hide resolved
@Shadow243 Shadow243 force-pushed the jmap-stalwart-new-release-check branch 4 times, most recently from c67579c to bec9482 Compare April 17, 2024 09:26
@Shadow243 Shadow243 force-pushed the jmap-stalwart-new-release-check branch from bec9482 to 4b1226d Compare April 17, 2024 09:28
@Shadow243
Copy link
Member Author

We tested the 'send message' button with Yannick.Nsenga, and it's working on his side. However, the blank issue seems to occur only on my end. I'm wondering if it's related to my network. This can be merged once the conversation is resolved, but the issue #945 may require us to investigate why it's displaying a blank page on certain networks.

@kroky kroky merged commit b93c2c9 into cypht-org:master Apr 18, 2024
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.

None yet

3 participants