Jump to content

Clover13

Clients
  • Posts

    1,380
  • Joined

  • Last visited

  • Days Won

    1

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Everything posted by Clover13

  1. I'm on like my 6th review now trying to figure out what they need or want to verify the app and business. I upload exactly what they require, I send messages asking for feedback, I try to send messages to their Support Chat and receive no answers. It's been denied twice and the supporting reasoning was either corrected or incorrect (as that exact information was indeed provided). The other times, the review was just cancelled with no reason (after weeks+ of waiting).
  2. I see how you tracked it down in the PHP code, I'll try to do that next time as well. I'm not too PHP savvy, but I see the stacktrace there and how you tracked it down, thank you for doing that! 👍 Also confirming with revisions OFF for the Pages DB, it does work and returns a 201 (CREATED) 2024-03-21 11:12:21 - INFO - post_cms_record_url: http://localhost/api/index.php?/cms/records/1 2024-03-21 11:12:21 - INFO - post_data: {'category': 1, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} 2024-03-21 11:12:21 - DEBUG - Starting new HTTP connection (1): localhost:80 2024-03-21 11:12:21 - DEBUG - http://localhost:80 "POST /api/index.php?/cms/records/1&key=ef2f4f1687b901d3c962f074dcd4528e HTTP/1.1" 201 1109
  3. Thanks @teraßyte. I noticed the edit aspect and had mentioned that earlier. I would think any POST to create a new record would fail in this case (which is what I'm experiencing across 3 different Pages DBs), but @Marc Stridgen wasn't able to reproduce it. @Marc Stridgen can you confirm you tested on 4.7.16?
  4. I'll do some more testing today. FWIW, the GET to the hello endpoint works fine. I'll also get appropriate errors when the POST executes and determines something like an invalid category or author. 2024-03-21 10:21:24 - INFO - post_cms_record_url: http://localhost/api/index.php?/cms/records/1 2024-03-21 10:21:24 - INFO - post_data: {'category': 99, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} 2024-03-21 10:21:24 - DEBUG - Starting new HTTP connection (1): localhost:80 2024-03-21 10:21:24 - DEBUG - http://localhost:80 "POST /api/index.php?/cms/records/1&key=ef2f4f1687b901d3c962f074dcd4528e HTTP/1.1" 400 72 Ran 1 test in 0.094s OK Error: 400 Response: {'errorCode': '1T306/5', 'errorMessage': 'NO_CATEGORY'} Regarding the hooks being disabled, that did not resolve the issue. 2024-03-21 10:25:57 - INFO - post_cms_record_url: http://localhost/api/index.php?/cms/records/1 2024-03-21 10:25:57 - INFO - post_data: {'category': 1, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} 2024-03-21 10:25:57 - DEBUG - Starting new HTTP connection (1): localhost:80 Error: 500 Response: {'errorCode': 'EX1048', 'errorMessage': 'UNKNOWN_ERROR'} 2024-03-21 10:25:58 - DEBUG - http://localhost:80 "POST /api/index.php?/cms/records/1&key=ef2f4f1687b901d3c962f074dcd4528e HTTP/1.1" 500 72
  5. FWIW... # With API Key in request params returns 500 and EX1048 response = requests.post(post_cms_record_url, data=post_data, params=request_params) # With API Key base64 encoded in headers # Error: 401 # Response: {'errorCode': '3S290/7', 'errorMessage': 'INVALID_API_KEY'} response = requests.post(post_cms_record_url, data=post_data, headers=headers) # With API Key in auth returns 500 and EX1048 response = requests.post(post_cms_record_url, data=post_data, auth=auth)
  6. Right and I believe that's due to the first screenshot I posted where it's expecting a record_id when one doesn't exist yet since this is creating a record, not editing one. Unless that DB update is made after the record is created (but not committed yet), I don't know the sequencing or transactionalization of their DB commands for the API. Maybe it's due to the api key being a request param instead of a header, but the header approach wouldn't work for me before this current version of the software.
  7. I dropped the data parsing for the non-200 case, here is that output: 2024-03-20 16:38:05 - INFO - post_cms_record_url: http://localhost/api/index.php?/cms/records/1 2024-03-20 16:38:05 - INFO - post_data: {'category': 1, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} 2024-03-20 16:38:05 - DEBUG - Starting new HTTP connection (1): localhost:80 2024-03-20 16:38:05 - DEBUG - http://localhost:80 "POST /api/index.php?/cms/records/1&key=ef2f4f1687b901d3c962f074dcd4528e HTTP/1.1" 500 72 Ran 1 test in 0.179s OK Error: 500 Response: {'errorCode': 'EX1048', 'errorMessage': 'UNKNOWN_ERROR'}
  8. It's just a python script, I put this together to post to the default Articles Pages DB and get a 500 as well. def test_api_cms_post(self): post_cms_record_url = f"{self.API_URL}{self.CMS_RECORDS_ENDPOINT}1" logging.info(f"post_cms_record_url: {post_cms_record_url}") # Request parameters with API key included in the URL request_params = { 'key': self.API_KEY } post_data = {'category': 1, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} logging.info(f"post_data: {post_data}") # Make a POST request to the API endpoint response = requests.post(post_cms_record_url, data=post_data, params=request_params) # Check if the request was successful (status code 200) if response.status_code == 200: # Parse the JSON response data = response.json() # Process the data as needed print("Response:", data) else: # Print an error message if the request was not successful print(f"Error: {response.status_code}") Output: 2024-03-20 16:13:43 - INFO - post_cms_record_url: http://localhost/api/index.php?/cms/records/1 2024-03-20 16:13:43 - INFO - post_data: {'category': 1, 'author': 1, 'fields[1]': 'Title 123', 'fields[2]': 'Content ABC'} 2024-03-20 16:13:43 - DEBUG - Starting new HTTP connection (1): localhost:80 Error: 500 2024-03-20 16:13:43 - DEBUG - http://localhost:80 "POST /api/index.php?/cms/records/1&key=ef2f4f1687b901d3c962f074dcd4528e HTTP/1.1" 500 72 Ran 1 test in 0.140s OK
  9. I tried another Pages DB and POST call that worked before the update and it too is getting the same error.
  10. Was working on something new and started issuing POSTs to a Pages DB but it's erroring with a 500. System log entry below. Being this is a create of a record via a POST, I'm not sure why it is triggering an edit (requiring a record_id) which is also via a POST.
  11. Awesome! Thanks John for the very detailed reply and providing your experiences! That's very helpful!
  12. So I was thinking about @Nathan Explosion's proposed solution, however one stickler came to mind in that for larger API responses where filtering might be useful, there may not be a straightforward way to do this. Possibly would require parsing the API response and storing key/value pairs based on some discriminator and then having a dropdown multi-select to only show the values for those keys selected. A Pages DB would have this filtering capability built in it already by defining what fields are filterable and then putting the Pages DB Filter block within the Page.
  13. Regarding @Nathan Explosion's reply, for anyone interested in reviewing that approach, this link is helpful: https://invisioncommunity.com/developers/docs/general/caching-r8/
  14. Thank you for the detailed response John, I appreciate it! Ideally, I'm trying to avoid a custom app tied to IPS if possible and just use the native Pages impl and customize it within Pages. But perhaps doing it with a custom app is a reasonable approach to, as it would require some level of custom coding anyway. The data can be out of date, it's really just daily data list from an API, of which gets updated at unknown times. I definitely want to pull it on a schedule vs on demand (by a user viewing the page where the data will be presented). There's no API notification of updates that I'm aware of. As far as caching, I guess this comes down to what the Pages DB can do. With that in mind, there are many sites using Pages with a Pages DB and data under heavy user volume, so I'd have to imagine there is some level of data and page caching when a Pages DB is inserted as a block on a page. I'll likely start with that approach before I go custom and see how it works out. Thanks again for the insights!
  15. This one? https://developer.chrome.com/docs/web-platform/deprecating-unload If so, Ending with 100% of users by the end of Q3 2024 Assuming that means anyone on v4 won't be able to use Chrome after the deprecation?
  16. I'm looking to use a third party API to GET some data that doesn't change often throughout the day and then display it on a Pages page. The API has these considerations: There is no known timeframes when the API data will be updated. We are only concerned with the current snapshot of data, not any history. The API is rate limited, and we certainly don't want to call it for every page load. The amount of data is small but each record does have a start/end date for managing expired records. However, it may be easier to just replace all of the data stored versus trying to perform an upsert operation. What would you recommend as an approach for this when trying to display it within Invision Community? Goals: Retrieve data from third party API to format and display within a Pages page. Leverage caching of the data for performance. Rinse/repeat calling the third party API under set intervals or after expiry, removing all data from storage/cache and replacing it with the current API response data. Possible approaches: Use Zapier OR code a script (scheduled under cron) to GET from the third party API and POST the data to a Pages DB. Build a Pages template to display the data as desired. How to manage data caching in this instance? Write custom code directly in a Pages PHP block and embed that block within a Pages page. I'm assuming the PHP is what's cached in a block not the data, so I can use a separate self managed cache (say Memcached or Redis) to store the data and verify expiry between calls such that the API is only called after expiry of the cache?
  17. This does appear to be fixed across all three of my sites now with the latest release after rebuilding the images. I did notice some nuances when doing a second update where I had to reupload the same images again to force a third rebuild, but eventually everything look good. Correct app icon when saved to home screen. Correct splash screen icon on startup Correct splash screen background color on startup Thanks!
  18. You can control maximum images size to store and to display independently within the AdminCP. I set mine to display the maximum of what I want for desktop display, and anything smaller just displays smaller whether it's a smaller uploaded file or natively gets sized down for mobile. It would be cool however to allow click and drag resizing behavior for the embedded image, but I'm not sure of your use case for this unless you wanted to do some side by side display and the default AdminCP settings didn't allow for that due to being too large. My sites generally use an image per line in Forum topics and members have been good with that. Can't say anyone has ever asked about doing the resize you mention, but I can think of display cases where it would be useful.
  19. This looks better for sure, the one thing I noticed that wasn't fixed was the total record count. Regardless of filters selected, it seems to always be the total unfiltered count. Not a huge issue, but misleading if you're expecting and/or need the count of filtered items.
  20. Any ideas on this one? Every API record created I have to manually go and edit it and re-save to get the thumbnail sized correctly.
  21. Well, not sure if this definitively indicates anything, but the PWA does display both the app icon saved to the Home Screen and the splash screen correctly with my device simulated on Safari Developer Tools ala XCode Simulator 15.2 with iOS 17.2 on my iPhone 13 Pro Max. The PWA also shows correctly on Browserstack's simulator for my device. So either the simulators are off or there is something on my device that is either not displaying correctly or something is cached somewhere other than Safari website data. Also worth noting, 15.2/17.2 on an iPhone 15 did not display the splash screen correctly. Not sure if there is a new size for their latest device that is missing from the meta tags and images generated. Will keep tinkering, but that's as close as I can simulate my device vs completely different behavior on the same actual physical device.
  22. Clearing my Safari history and website data should get rid of it though, no?
  23. I am deleting the CDN files (S3) so it forces an entire rebuild the next time I upload images via the IPS AdminCP and purging the entire site cache in CF. When I visit the physical links in no-cache private/incognito browser window, they do appear correctly. Part of me wonders if the Apple device is just not interpreting it correctly OR if there is something specific about each image required in the IPS AdminCP for setting up the PWA (i.e. certain exact sizing is required, or certain image properties are required, etc).
×
×
  • Create New...