samuelwillyanto1 opened a new issue, #8328:
URL: https://github.com/apache/hop/issues/8328

   ### Apache Hop version?
   
   2.19.0
   
   ### Java version?
   
   21
   
   ### Operating system
   
   Windows
   
   ### What happened?
   
   In the workflow action **Get mails (POP3/IMAP)**, when configured with the 
**IMAP** protocol, changing the **Retrieve** option in the **Settings** tab 
(for example, selecting **"Get unread messages"**) fails to persist across 
sessions. After saving, closing the workflow tab, and reopening it, the setting 
reverts to **"Get all messages"**. 
   
   As a direct consequence, running the workflow retrieves all messages instead 
of filtering only unread ones. Additionally, attempting to deserialize or 
inspect the generated XML in previous Hop versions results in a 
`NumberFormatException: For input string: "ignore"`.
   
   ---
   
   ### Step-by-Step Guide to Reproduce
   
   Follow these exact steps from a clean session:
   
   #### Step 1: Create a New Workflow
   1. Launch Hop GUI.
   2. In the file navigation or menu bar, click **File** -> **New** -> 
**Workflow**.
   
   #### Step 2: Add Required Actions
   1. From the actions palette on the left, drag and drop the **Start** action 
onto the workflow canvas.
   2. Drag and drop the **Get mails (POP3/IMAP)** action onto the workflow 
canvas.
   3. Hover over **Start**, click and drag the connecting hop line to **Get 
mails (POP3/IMAP)** to establish an unconditional connection.
   
   #### Step 3: Configure IMAP Protocol
   1. Double-click the **Get mails (POP3/IMAP)** action icon to open its 
configuration dialog.
   2. On the **General** tab:
      * Keep the default action name or set any name (e.g., `Get mails 
(POP3/IMAP)`).
      * In the **Protocol** dropdown, select **IMAP**.
   
   #### Step 4: Configure Retrieve Setting
   1. Switch to the **Settings** tab at the top of the dialog.
   2. Under the **IMAP settings** section:
      * Locate the **Retrieve** dropdown field.
      * Change its value from the default `Get all messages` to **`Get unread 
messages`**.
      * Leave all other optional fields (such as server credentials or folders) 
as needed for reproduction.
   
   #### Step 5: Save and Close Workflow
   1. Click **OK** at the bottom of the dialog to apply the changes.
   2. Save the workflow via **File** -> **Save** (or press `Ctrl + S`), naming 
it `test_get_mail_issue.hwf`.
   3. Close the active workflow tab by clicking the **x** on the editor tab 
title.
   
   #### Step 6: Reopen and Verify the Regression
   1. Open the saved file `test_get_mail_issue.hwf` via **File** -> **Open**.
   2. Double-click the **Get mails (POP3/IMAP)** action to open the dialog.
   3. Switch to the **Settings** tab and inspect the **Retrieve** dropdown 
under **IMAP settings**.
   
   ---
   
   ### Expected Behavior vs. Actual Behavior
   
   | Criteria | Expected Behavior | Actual Behavior |
   | :--- | :--- | :--- |
   | **Persisted Setting** | The **Retrieve** dropdown remains **`Get unread 
messages`**. | The dropdown reverts back to **`Get all messages`**. |
   | **Pipeline/Workflow Execution** | The step connects to the IMAP server and 
only processes messages marked unread. | The step pulls **all messages** from 
the inbox, ignoring the unread filter. |
   | **Backward Compatibility / XML Parsing** | Valid XML structure for 
serialization and deserialization. | Fails with `NumberFormatException: For 
input string: "ignore"` when parsed or loaded across certain versions. |
   
   ---
   
   ### Stack Trace / Error Log (Backward Compatibility Failure)
   
   When a workflow containing the **Get mails (POP3/IMAP)** action configured 
with **IMAP** and **Retrieve: Get unread messages** is created and saved in 
**Apache Hop 2.13.0** (where it persists and reopens normally), attempting to 
open this same workflow file in **Apache Hop 2.19.0** completely fails to load 
with the following error dialog and stack trace:
   
   ```text
   Unable to load workflow info from XML node
   
   Unable to instantiate a new instance of class 
org.apache.hop.workflow.action.ActionMeta: make sure there is an empty public 
constructor available to allow XML de-serialization
   For input string: "ignore"
   
   Root cause: NumberFormatException: For input string: "ignore"
   ```
   
   ---
   
   ### Visual Evidence
   
   * **Screenshot A (Configuration):** Shows IMAP settings with `Retrieve` set 
to `Get unread messages`.
   
   <img width="712" height="747" alt="Image" 
src="https://github.com/user-attachments/assets/5627e327-c215-4145-8af4-07ee1369da72";
 />
   
   * **Screenshot B (Post-Reopen):** Shows IMAP settings automatically reverted 
to `Get all messages` after reloading the workflow file.
   
   <img width="700" height="745" alt="Image" 
src="https://github.com/user-attachments/assets/41a9da51-5910-4424-a167-2d7d8ec4a630";
 />
   
   ### Issue Priority
   
   Priority: 1
   
   ### Issue Component
   
   Component: Workflows, Component: Actions


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to