konnectors/cozy-konnector-cesu

No document synchronized

Closed this issue · 4 comments

When using this connector, no document is fetched / synchronized.

Analyzing the code, I found that this request was sent to the CESU website:

 '/bulletinsSalaire?numInterneSalarie=&dtDebutRecherche=20130101&dtFinRecherche=20500101&numStart=0&nbAffiche=1000&numeroOrdre=0'

Once submitted to the website, the following result is received:

{
  "listeMessages" : [ {
    "codeInterne" : 31,
    "contenu" : "La date de recherche doit être comprise dans les 5 dernières années",
    "log" : null
  } ],
  "hasMessage" : true,
  "hasMsgAvert" : false,
  "hasMsgErrFonc" : true,
  "hasMsgErrTech" : false,
  "hasMsgInfo" : false,
  "listeObjets" : [ ]
}

which certainly explains the lack of response.
When updating the "dtDebutRecherche" to 20140101, I receive a JSON with expected results.

I propose that the request is updated to match this constraint. Not hardcoded, but computed from the current time in order to be time proof.

It may also be the opportunity to handle received messages, and logging them or presenting them to the user.

Thanks for this analysis @llange 👍
I reproduce this problem with my account.

@llange The version 1.2.0 of the connector is now available. I tested it but can you check it also works for you?

+Hi @doubleface , thanks a lot, I confirm that v1.2.0 fixes the issue with the lack of documents.
Now I have a proper synchronization, thank you.

Should I open another issue for the handling of received messages (directing them either to log; or to the user) ?

@llange go ahead 👍