Uploaded image for project: 'FOLIO'
  1. FOLIO
  2. FOLIO-3208

UI modules do not always supply ISO-8601 dates in API requests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P1
    • Resolution: Done
    • None
    • Prokopovych - Sprint 117, Prokopovych - Sprint 118, Prokopovych - Sprint 119
    • Prokopovych
    • R3 2021

    Description

      Overview: UI modules do not supply ISO-8601 dates if the tenant-locale is ar (Arabic).

      Details: As noted on Slack, UI apps supply Eastern Arabic numerals in API requests when the tenant API is set to ar.

      Steps to Reproduce:

      1. Log into folio-snapshot as a user with permission to (a) check out items and (b) use developer tools to change the session locale
      2. Visit Settings > Developer > Session locale and change the session locale to Arabic
      3. Visit Check out and attempt to charge any item to any active user

      Expected Results: Successful check out
      Actual Results: Failed checkout due to a 500 from circulation/check-out-by-barcode because of incorrect data in the loanDate field of the POST body:

      POST /circulation/check-out-by-barcode
      {
        "itemBarcode":"b612",
        "userBarcode":"789",
        "servicePointId":"7c5abc9f-f3d7-4856-b8d7-6712462ca007",
        "loanDate":"٢٠٢١-٠٦-١٦T١٣:٣٠:٢٦Z",
        "id":"02b850d2-9a7b-4ece-b352-43d8a23b90c1"
      }
      
      Invalid format: "٢٠٢١-٠٦-١٦T١٣:٣٠:٢٦Z"
      java.lang.IllegalArgumentException: Invalid format: "٢٠٢١-٠٦-١٦T١٣:٣٠:٢٦Z"
      	at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945)
      	at org.joda.time.DateTime.parse(DateTime.java:160)
      	at org.joda.time.DateTime.parse(DateTime.java:149)
      	at org.folio.circulation.support.json.JsonPropertyFetcher.getDateTimeProperty(JsonPropertyFetcher.java:92)
      	at org.folio.circulation.support.json.JsonPropertyFetcher.getDateTimeProperty(JsonPropertyFetcher.java:85)
      	at org.folio.circulation.domain.Loan.getLoanDate(Loan.java:247)
      	at org.folio.circulation.resources.CheckOutByBarcodeResource.checkOut(CheckOutByBarcodeResource.java:215)
      	at org.folio.circulation.resources.CheckOutByBarcodeResource.lambda$checkOut$12(CheckOutByBarcodeResource.java:133)
      	at org.folio.circulation.support.results.Result.after(Result.java:252)
      	at org.folio.circulation.resources.CheckOutByBarcodeResource.lambda$checkOut$13(CheckOutByBarcodeResource.java:133)
      	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
      	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
      	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
      	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
      	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
      	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
      	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
      

      It isn't clear if this is a problem with how

      1. moment is configured in src/loginServices, in which case it's an STCOR bug
      2. timestamps are created in individual apps, e.g. loanDate: moment().utc().format(), in which case it's a per-app bug and we need to file separate tickets for every instance of moment()...format()
      3. both

      CC: ostephens

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                zburke Zak_Burke
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases