Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-05-17 Thread via GitHub


AnTu2702 commented on PR #8494:
URL: https://github.com/apache/nifi/pull/8494#issuecomment-2116939703

   Der alte E-Mail Stack kann abgerissen werden jetzt.
   Wir lassen aber den parallelen Betrieb des alten und neuen WhatsApp 
Postfachs in NIFI vorerst aktiv, bis wieder WhatsApp Emails eintrudeln. Danach 
schalten wir den Alias um und reißen die alten NIFI Prozesse ab.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-05-17 Thread via GitHub


AnTu2702 commented on PR #8494:
URL: https://github.com/apache/nifi/pull/8494#issuecomment-2116938052

   
![image](https://github.com/apache/nifi/assets/5054213/41b10193-93f0-4a87-9d52-a62a146d4268)
   


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-05-13 Thread via GitHub


tpalfy commented on PR #8494:
URL: https://github.com/apache/nifi/pull/8494#issuecomment-2108094848

   Hi @AnTu2702,
   
   Do you happen to try connecting to an Office365 account?
   The issue you mention didn't occur when I was testing but when googled it, 
it gave me several results users complaining about this when using Office365.
   
   According to one search result this can be caused by clients that are trying 
to connect too frequently. Can you try lowering the schedule period and see if 
that helps?
   Others suggest checking the OAuth config of Office365.
   
   Couple of links for reference:
   
https://confluence.atlassian.com/jirakb/imap-fails-with-a3-bad-user-is-authenticated-but-not-connected-error-in-jira-server-integrated-with-office365-665420269.html
   https://github.com/mscdex/node-imap/issues/689


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-05-13 Thread via GitHub


AnTu2702 commented on PR #8494:
URL: https://github.com/apache/nifi/pull/8494#issuecomment-2106900968

   @tpalfy Hey. How are you?
   
   First of all: Thanks for the fix/workaround in NIFI 1.26.
   Although things are basically working there, we still don't seem to be 
through.
   
   The ConsumeIMAP Processor is continuously logging this ERROR...
   (although the mailbox can and will be processed successfully using a 
refreshed token...)
   
   
![image](https://github.com/apache/nifi/assets/5054213/d42a733c-42d2-469c-b442-bd0addb61845)
   
   We still have serious doubts to take this into production because of the log 
being spammed and of course the fact, that we have no clue, what causes this 
error.
   
   Could you help and double check your fix/workaround?
   Thank you in advance...


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-26 Thread via GitHub


asfgit closed pull request #8494: NIFI-12888 In AbstractEmailProcessor recreate 
email receiver when token expires.
URL: https://github.com/apache/nifi/pull/8494


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-26 Thread via GitHub


dan-s1 commented on PR #8494:
URL: https://github.com/apache/nifi/pull/8494#issuecomment-2020630980

   @exceptionfactory I think with the latest commit everything seems okay.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-21 Thread via GitHub


tpalfy commented on code in PR #8494:
URL: https://github.com/apache/nifi/pull/8494#discussion_r1534001750


##
nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java:
##
@@ -307,7 +309,11 @@ String buildUrl(ProcessContext processContext) {
  * and is ready to receive messages.
  */
 private synchronized void initializeIfNecessary(ProcessContext context, 
ProcessSession processSession) {
-if (this.messageReceiver == null) {
+if (
+this.messageReceiver == null
+||
+oauth2AccessDetailsRefreshed()
+) {

Review Comment:
   Okay, maybe I went overboard with this one :)



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-21 Thread via GitHub


tpalfy commented on code in PR #8494:
URL: https://github.com/apache/nifi/pull/8494#discussion_r1534000906


##
nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java:
##
@@ -324,6 +330,18 @@ private synchronized void 
initializeIfNecessary(ProcessContext context, ProcessS
 }
 }
 
+private boolean oauth2AccessDetailsRefreshed() {
+boolean oauthDetailsRefreshed = 
this.oauth2AccessTokenProviderOptional.isPresent()
+&&
+(
+this.oauth2AccessDetails == null
+||
+
!oauth2AccessDetails.equals(this.oauth2AccessTokenProviderOptional.get().getAccessDetails())
+);
+
+return oauthDetailsRefreshed;
+}

Review Comment:
   I usually find it the case that once you understand the complex condition 
you find the cluttered presentation more appealing. But only after that. When 
it's cluttered, one needs to look more carefully to understand the relationship 
between the parts and think through more carefully.
   
   But I think can come up with a compromise and make it more streamlined a bit.
   
   As for doing it in a return statement - I find it much better to return a 
single variable.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-15 Thread via GitHub


dan-s1 commented on code in PR #8494:
URL: https://github.com/apache/nifi/pull/8494#discussion_r1526378053


##
nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java:
##
@@ -324,6 +330,18 @@ private synchronized void 
initializeIfNecessary(ProcessContext context, ProcessS
 }
 }
 
+private boolean oauth2AccessDetailsRefreshed() {

Review Comment:
   The usual convention to name methods that return boolean is to ask a 
question in the name usually by using is/has as the prefix.
   ```suggestion
   private boolean isOauth2AccessDetailsRefreshed() {
   ```



##
nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java:
##
@@ -324,6 +330,18 @@ private synchronized void 
initializeIfNecessary(ProcessContext context, ProcessS
 }
 }
 
+private boolean oauth2AccessDetailsRefreshed() {
+boolean oauthDetailsRefreshed = 
this.oauth2AccessTokenProviderOptional.isPresent()
+&&
+(
+this.oauth2AccessDetails == null
+||
+
!oauth2AccessDetails.equals(this.oauth2AccessTokenProviderOptional.get().getAccessDetails())
+);
+
+return oauthDetailsRefreshed;
+}

Review Comment:
   Couldn't this all be done in a `return` statement
   ```suggestion
   return this.oauth2AccessTokenProviderOptional.isPresent() && 
(this.oauth2AccessDetails == null ||  
!oauth2AccessDetails.equals(this.oauth2AccessTokenProviderOptional.get().getAccessDetails())
 ;
   }
   ```



##
nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java:
##
@@ -307,7 +309,11 @@ String buildUrl(ProcessContext processContext) {
  * and is ready to receive messages.
  */
 private synchronized void initializeIfNecessary(ProcessContext context, 
ProcessSession processSession) {
-if (this.messageReceiver == null) {
+if (
+this.messageReceiver == null
+||
+oauth2AccessDetailsRefreshed()
+) {

Review Comment:
   Per earlier comment and remove unnecessary white space
   ```suggestion
   if (this.messageReceiver == null || isOauth2AccessDetailsRefreshed()
   ) {
   ```



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] NIFI-12888 In AbstractEmailProcessor recreate email receiver when token expires. [nifi]

2024-03-12 Thread via GitHub


tpalfy opened a new pull request, #8494:
URL: https://github.com/apache/nifi/pull/8494

   
   
   
   
   
   
   
   
   
   
   
   
   
   # Summary
   
   [NIFI-12888](https://issues.apache.org/jira/browse/NIFI-12888)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-0`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
 - [ ] JDK 21
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org