mptwaktusolat / app_waktu_solat_malaysia

Prayer times app for Malaysia. Accurate data from JAKIM. Install the app on your phones now.
https://play.google.com/store/apps/details?id=live.iqfareez.waktusolatmalaysia
GNU General Public License v3.0
45 stars 22 forks source link

[JAKIM] Error when fetching from KTN03 #160

Closed iqfareez closed 1 year ago

iqfareez commented 1 year ago

Overview

Approximately at 10 am (1/12/2022), I received an automated email from GitHub saying that the scheduled workflow run from mpt-backup-api has failed.

image

Looking at the logs, the fetcher keeps retrying to fetch KTN03 from JAKIM API. The status code is 200 so maybe there are something that is not OK

Full logs of the workflow step here: 5_execute py script.txt

Updates

10.00 am MYT Investigation begin by opening the MPT app and change location to KTN03. As I'am expecting, an error appeared:

10.26 am MYT

I simulate the API call in insomnia:

https://www.e-solat.gov.my/index.php?r=esolatApi/TakwimSolat&period=month&zone=KTN03

Response:

{
    "prayerTime": {
        "data": [
            "No data available for the current request"
        ]
    },
    "status": "NO_RECORD!",
    "serverTime": "2022-12-01 10:20:05",
    "periodType": "month",
    "lang": "ms_my",
    "zone": "KTN03",
    "bearing": "291° 40′ 41″"
}

Duh? No data is available?

AFAIK, For Kelantan, JAKIM has two zones only: KTN01 and KTN03. (Yep, KTN02 was not there the whole time, even this guy from 2010 also noticed that KTN02 was not there)

image ^ Wayback machine to 2019

So, I retried the Insomnia request with KTN02

Response (boom! KTN02 that has been sleeping for eternity has awaken):

{
    "prayerTime": [
        {
            "hijri": "1444-05-06",
            "date": "01-Dec-2022",
            "day": "Thursday",
            "imsak": "05:44:00",
            "fajr": "05:54:00",
            "syuruk": "07:07:00",
            "dhuhr": "13:04:00",
            "asr": "16:26:00",
            "maghrib": "18:59:00",
            "isha": "20:09:00"
        },
        {
            "hijri": "1444-05-07",
            "date": "02-Dec-2022",
            "day": "Friday",
            "imsak": "05:44:00",
            "fajr": "05:54:00",
            "syuruk": "07:07:00",
            "dhuhr": "13:05:00",
            "asr": "16:27:00",
            "maghrib": "18:59:00",
            "isha": "20:09:00"
        },
        .... lain2 sy buang, panjang sgt
    ],
    "status": "OK!",
    "serverTime": "2022-12-01 10:20:42",
    "periodType": "month",
    "lang": "ms_my",
    "zone": "KTN02"
}

10.47 am MYT Time to made decision. Discussed below

8.44pm MYT Done re-fetch the whole thing, and made duplicate for KTN03 for backward compatibility. Deployed mpt-server with updated data just now.

Discussion

One question I had in mind. Is this change (KTN03 to KTN02) is permanent or temporary? It is hard to tell as I couldn't find any announcements of this change (including the official portal: https://www.islam.gov.my)

Only time can tell. For now, I'm gonna fix the fetcher script to point to KTN02. Since the app is hardcoded to KTN03, I need to duplicate the data to KTN03 so the app can fetch it.

iqfareez commented 1 year ago

Its 15/12/2022, e-solat JAKIM still using KTN02. So perhaps this change is permanent.

I'll wait until January 2023.

image